質問編集履歴
2
コードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
```
|
30
|
-
##
|
30
|
+
##_search_modal.html.erb
|
31
31
|
```
|
32
32
|
<div class="modal js-modal">
|
33
33
|
<div class="modal__bg js-modal-close"></div>
|
@@ -64,4 +64,15 @@
|
|
64
64
|
});
|
65
65
|
});
|
66
66
|
</script>
|
67
|
+
```
|
68
|
+
##_search.html.erb
|
69
|
+
```
|
70
|
+
<div class="text-center mt-5">
|
71
|
+
<%= form_tag({ :controller => 'main', :action => 'top'},{ :method => :get}) do %>
|
72
|
+
<p>
|
73
|
+
<%= text_field_tag :search, params[:search] %>
|
74
|
+
<%= submit_tag "Search", :id => "js-modal-open" %>
|
75
|
+
</p>
|
76
|
+
<% end %>
|
77
|
+
</div>
|
67
78
|
```
|
1
table.rbの編集をしました
title
CHANGED
File without changes
|
body
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
class Table < ActiveRecord::Base
|
14
14
|
belongs_to :user
|
15
15
|
def self.search(search) #self.でクラスメソッドとしている
|
16
|
-
Table.where(['languages LIKE ?', "%#{search}%"])
|
16
|
+
Table.where(['languages LIKE ?', "%#{search}%"])
|
17
17
|
end
|
18
18
|
end
|
19
19
|
```
|