質問編集履歴

1

confirmの追加

2020/06/06 14:57

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -201,3 +201,95 @@
201
201
  1 | 1 | 1 | 2020-06-06 12:13:59.321134 | 2020-06-06 12:13:59.321134
202
202
 
203
203
  ```
204
+
205
+
206
+
207
+ ちなみにcategory_idsはチェックボックスで値を取得しています
208
+
209
+ ```ここに言語を入力
210
+
211
+ new.html.slim
212
+
213
+
214
+
215
+ = f.collection_check_boxes(:category_ids, Category.all, :id, :name) do |category|
216
+
217
+ .item_tag
218
+
219
+ = category.label do
220
+
221
+ = category.check_box
222
+
223
+ .item-span
224
+
225
+ span = category.text
226
+
227
+ ```
228
+
229
+
230
+
231
+ 確認画面はこんな感じです。
232
+
233
+ ```ここに言語を入力
234
+
235
+ confirm.html.slim
236
+
237
+
238
+
239
+
240
+
241
+ = form_for :post, url: new_post_path do |f|
242
+
243
+ = f.hidden_field :area
244
+
245
+ = f.hidden_field :station
246
+
247
+ = f.hidden_field :place_name
248
+
249
+ = f.hidden_field :post_photo_cache
250
+
251
+ = f.hidden_field :shop_name
252
+
253
+ = f.hidden_field :street_address
254
+
255
+ = f.hidden_field :time
256
+
257
+ = f.hidden_field :regular_holiday
258
+
259
+ = f.hidden_field :url
260
+
261
+ = f.hidden_field :category_ids
262
+
263
+ div[style="text-align: center;"]
264
+
265
+ = f.submit "入力画面に戻る", class: "btn-back"
266
+
267
+ = form_for :post, url: posts_path do |f|
268
+
269
+ = f.hidden_field :area
270
+
271
+ = f.hidden_field :station
272
+
273
+ = f.hidden_field :place_name
274
+
275
+ = f.hidden_field :post_photo_cache
276
+
277
+ = f.hidden_field :shop_name
278
+
279
+ = f.hidden_field :street_address
280
+
281
+ = f.hidden_field :time
282
+
283
+ = f.hidden_field :regular_holiday
284
+
285
+ = f.hidden_field :url
286
+
287
+ = f.hidden_field :category_ids
288
+
289
+ div[style="text-align: center;"]
290
+
291
+ = f.submit "確認へ進む", class: "btn btn-square"
292
+
293
+
294
+
295
+ ```