質問編集履歴
3
エラーメッセージを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,7 +32,13 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
|
35
|
+
URLをみると下記の記載がありました。
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
・URLの抜粋
|
40
|
+
|
41
|
+
us-east-2.amazonaws.com/customers/search.%23<Customer::ActiveRecord_Relation:0x007fa9745b1420>
|
36
42
|
|
37
43
|
|
38
44
|
|
2
コードを追記。
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,17 +14,23 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
+
現状、分けることは成功しましたが、
|
18
|
+
|
19
|
+
検索結果側で何も表示されず。。
|
20
|
+
|
21
|
+
|
22
|
+
|
17
23
|
### 発生している問題・エラーメッセージ
|
18
24
|
|
19
25
|
|
20
26
|
|
21
27
|
検索画面(index)と検索結果(search)をわけるにあたり、
|
22
28
|
|
23
|
-
ルーティングを書いて、検索画面(index)
|
29
|
+
ルーティングを書いて、検索画面(index)から検索後、
|
24
30
|
|
25
|
-
検索結果(search)
|
31
|
+
検索結果(search)側の画面で何も表示されず。。
|
26
32
|
|
27
|
-
|
33
|
+
|
28
34
|
|
29
35
|
勉強不足で申し訳ないですが、、ご指示頂けますと幸いです。
|
30
36
|
|
@@ -38,7 +44,7 @@
|
|
38
44
|
|
39
45
|
Prefix Verb URI Pattern Controller#Action
|
40
46
|
|
41
|
-
customers
|
47
|
+
search_customers GET /customers/search(.:format) customers#search
|
42
48
|
|
43
49
|
customers GET /customers(.:format) customers#index
|
44
50
|
|
@@ -74,7 +80,7 @@
|
|
74
80
|
|
75
81
|
<%= text_field_tag :search %>
|
76
82
|
|
77
|
-
<%=
|
83
|
+
<%= link_to 'Search', search_customers_path(@customers) %>
|
78
84
|
|
79
85
|
<% end %>
|
80
86
|
|
@@ -104,9 +110,9 @@
|
|
104
110
|
|
105
111
|
<% end %>
|
106
112
|
|
107
|
-
<% end %>
|
108
113
|
|
109
114
|
|
115
|
+
<% end %>
|
110
116
|
|
111
117
|
・customers_controller.rb
|
112
118
|
|
@@ -122,9 +128,7 @@
|
|
122
128
|
|
123
129
|
def index
|
124
130
|
|
125
|
-
|
126
131
|
|
127
|
-
@customers = Customer.search(params[:search])
|
128
132
|
|
129
133
|
end
|
130
134
|
|
@@ -132,13 +136,15 @@
|
|
132
136
|
|
133
137
|
def search
|
134
138
|
|
135
|
-
|
139
|
+
@customers = Customer.search(params[:search])
|
136
140
|
|
137
141
|
end
|
138
142
|
|
139
143
|
|
140
144
|
|
141
145
|
・customer.rb
|
146
|
+
|
147
|
+
|
142
148
|
|
143
149
|
class Customer < ApplicationRecord
|
144
150
|
|
@@ -170,11 +176,11 @@
|
|
170
176
|
|
171
177
|
|
172
178
|
|
173
|
-
indexページを表示し、検索ワードを入れて検索すると画面遷移
|
179
|
+
indexページを表示し、検索ワードを入れて検索すると画面遷移はするものの、
|
174
180
|
|
175
|
-
|
181
|
+
検索結果側でデータが表示されず。
|
176
182
|
|
177
|
-
|
183
|
+
コントローラのindexに値を追記したりしてみましたが変わらず。。
|
178
184
|
|
179
185
|
|
180
186
|
|
1
誤字を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
ルーティングを書いて、検索画面(index)の内容を
|
24
24
|
|
25
|
-
検索結果(search)
|
25
|
+
検索結果(search)に渡したいのですが、
|
26
26
|
|
27
27
|
実現方法が分からず困っております。。
|
28
28
|
|