質問編集履歴
2
ソースコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -288,6 +288,112 @@
|
|
288
288
|
|
289
289
|
|
290
290
|
|
291
|
+
ページのソースコード
|
292
|
+
|
293
|
+
```html
|
294
|
+
|
295
|
+
<select class="hoge" name="agent[prefecture_id]" id="agent_prefecture_id"><option value="--都道府県--">--都道府県--</option>
|
296
|
+
|
297
|
+
<option value="北海道">北海道</option>
|
298
|
+
|
299
|
+
<option value="青森県">青森県</option>
|
300
|
+
|
301
|
+
<option value="岩手県">岩手県</option>
|
302
|
+
|
303
|
+
<option value="宮城県">宮城県</option>
|
304
|
+
|
305
|
+
<option value="秋田県">秋田県</option>
|
306
|
+
|
307
|
+
<option value="山形県">山形県</option>
|
308
|
+
|
309
|
+
<option value="福島県">福島県</option>
|
310
|
+
|
311
|
+
<option value="茨城県">茨城県</option>
|
312
|
+
|
313
|
+
<option value="栃木県">栃木県</option>
|
314
|
+
|
315
|
+
<option value="群馬県">群馬県</option>
|
316
|
+
|
317
|
+
<option value="埼玉県">埼玉県</option>
|
318
|
+
|
319
|
+
<option value="千葉県">千葉県</option>
|
320
|
+
|
321
|
+
<option value="東京都">東京都</option>
|
322
|
+
|
323
|
+
<option value="神奈川県">神奈川県</option>
|
324
|
+
|
325
|
+
<option value="新潟県">新潟県</option>
|
326
|
+
|
327
|
+
<option value="富山県">富山県</option>
|
328
|
+
|
329
|
+
<option value="石川県">石川県</option>
|
330
|
+
|
331
|
+
<option value="福井県">福井県</option>
|
332
|
+
|
333
|
+
<option value="山梨県">山梨県</option>
|
334
|
+
|
335
|
+
<option value="長野県">長野県</option>
|
336
|
+
|
337
|
+
<option value="岐阜県">岐阜県</option>
|
338
|
+
|
339
|
+
<option value="静岡県">静岡県</option>
|
340
|
+
|
341
|
+
<option value="愛知県">愛知県</option>
|
342
|
+
|
343
|
+
<option value="三重県">三重県</option>
|
344
|
+
|
345
|
+
<option value="滋賀県">滋賀県</option>
|
346
|
+
|
347
|
+
<option value="京都府">京都府</option>
|
348
|
+
|
349
|
+
<option value="大阪府">大阪府</option>
|
350
|
+
|
351
|
+
<option value="兵庫県">兵庫県</option>
|
352
|
+
|
353
|
+
<option value="奈良県">奈良県</option>
|
354
|
+
|
355
|
+
<option value="和歌山県">和歌山県</option>
|
356
|
+
|
357
|
+
<option value="鳥取県">鳥取県</option>
|
358
|
+
|
359
|
+
<option value="島根県">島根県</option>
|
360
|
+
|
361
|
+
<option value="岡山県">岡山県</option>
|
362
|
+
|
363
|
+
<option value="広島県">広島県</option>
|
364
|
+
|
365
|
+
<option value="山口県">山口県</option>
|
366
|
+
|
367
|
+
<option value="徳島県">徳島県</option>
|
368
|
+
|
369
|
+
<option value="香川県">香川県</option>
|
370
|
+
|
371
|
+
<option value="愛媛県">愛媛県</option>
|
372
|
+
|
373
|
+
<option value="高知県">高知県</option>
|
374
|
+
|
375
|
+
<option value="福岡県">福岡県</option>
|
376
|
+
|
377
|
+
<option value="佐賀県">佐賀県</option>
|
378
|
+
|
379
|
+
<option value="長崎県">長崎県</option>
|
380
|
+
|
381
|
+
<option value="熊本県">熊本県</option>
|
382
|
+
|
383
|
+
<option value="大分県">大分県</option>
|
384
|
+
|
385
|
+
<option value="宮崎県">宮崎県</option>
|
386
|
+
|
387
|
+
<option value="鹿児島県">鹿児島県</option>
|
388
|
+
|
389
|
+
<option value="沖縄県">沖縄県</option></select>
|
390
|
+
|
391
|
+
</div>
|
392
|
+
|
393
|
+
```
|
394
|
+
|
395
|
+
|
396
|
+
|
291
397
|
|
292
398
|
|
293
399
|
### 試したこと
|
1
情報追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -94,8 +94,142 @@
|
|
94
94
|
|
95
95
|
```
|
96
96
|
|
97
|
+
app>controller>agents>registration_controller.rb
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
|
101
|
+
class Agents::RegistrationsController < Devise::RegistrationsController
|
102
|
+
|
103
|
+
before_action :configure_sign_up_params, only: [:create]
|
104
|
+
|
105
|
+
# before_action :configure_account_update_params, only: [:update]
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
# GET /resource/sign_up
|
110
|
+
|
111
|
+
def new
|
112
|
+
|
113
|
+
#@results = Agent.where('prefecture_id IN(?)', params[:prefecture_id])
|
114
|
+
|
115
|
+
super
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
# POST /resource
|
122
|
+
|
123
|
+
# def create
|
124
|
+
|
125
|
+
# super
|
126
|
+
|
127
|
+
# end
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
# GET /resource/edit
|
132
|
+
|
133
|
+
# def edit
|
134
|
+
|
135
|
+
# super
|
136
|
+
|
137
|
+
# end
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
# PUT /resource
|
142
|
+
|
143
|
+
# def update
|
144
|
+
|
145
|
+
# super
|
146
|
+
|
147
|
+
# end
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
# DELETE /resource
|
152
|
+
|
153
|
+
# def destroy
|
154
|
+
|
155
|
+
# super
|
156
|
+
|
157
|
+
# end
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
# GET /resource/cancel
|
162
|
+
|
163
|
+
# Forces the session data which is usually expired after sign
|
164
|
+
|
165
|
+
# in to be expired now. This is useful if the user wants to
|
166
|
+
|
167
|
+
# cancel oauth signing in/up in the middle of the process,
|
168
|
+
|
169
|
+
# removing all OAuth session data.
|
170
|
+
|
171
|
+
# def cancel
|
172
|
+
|
173
|
+
# super
|
174
|
+
|
175
|
+
# end
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
# protected
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
# If you have extra params to permit, append them to the sanitizer.
|
184
|
+
|
185
|
+
def configure_sign_up_params
|
186
|
+
|
187
|
+
devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute, :agentname, :agentname_kana, :first_name, :last_name, :first_name_kana, :last_name_kana, :prefecture_id, :address, :harbor, :how_to_go1, :how_to_go2, :tel1, :tel2, :homepage, :regular_holiday, :ice, :target, :ship_type_id, :fishing_type_id, :profile])
|
188
|
+
|
189
|
+
end
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
# If you have extra params to permit, append them to the sanitizer.
|
194
|
+
|
195
|
+
# def configure_account_update_params
|
196
|
+
|
197
|
+
# devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
|
198
|
+
|
199
|
+
# end
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
# The path used after sign up.
|
204
|
+
|
205
|
+
# def after_sign_up_path_for(resource)
|
206
|
+
|
207
|
+
# super(resource)
|
208
|
+
|
209
|
+
# end
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
# The path used after sign up for inactive accounts.
|
214
|
+
|
215
|
+
# def after_inactive_sign_up_path_for(resource)
|
216
|
+
|
217
|
+
# super(resource)
|
218
|
+
|
219
|
+
# end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
```
|
226
|
+
|
227
|
+
|
228
|
+
|
97
229
|
```erb
|
98
230
|
|
231
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
232
|
+
|
99
233
|
中略
|
100
234
|
|
101
235
|
<--! 都道府県のプルダウン -->
|