質問編集履歴

2

2021/09/27 08:06

投稿

tarotarotarotar
tarotarotarotar

スコア41

test CHANGED
File without changes
test CHANGED
@@ -1,16 +1,28 @@
1
1
  ```erb
2
2
 
3
- = form_with class: 'h-adr edit-form' do |f|
3
+ = form_with url: messages_create_mailing_label_path do |f|
4
4
 
5
- = f.hidden_field :for_yubinbango, value: "Japan", class: "p-country-name"
5
+ %table.mailing_list
6
6
 
7
- .form-row.mb-2
7
+ %tr
8
8
 
9
- .field.col-form-label.col-2
9
+ %th ID
10
10
 
11
- = f.label :relative_edit_family_name, "氏名"
11
+ %th 対象
12
12
 
13
- ~
13
+ %th 顧客名
14
+
15
+ %th 発送日
16
+
17
+ %th 支払い
18
+
19
+ - mailing_list.each_with_index do |customer, row_num|
20
+
21
+ = mailing_data(customer, row_num)
22
+
23
+ %input.btn.btn-primary.ml-auto.mr-4.mt-4.d-block{ type: 'submit', value: 'CSV出力', format: 'csv' }
24
+
25
+ %a{ class: 'd-none', id: 'csv_downloader'}
14
26
 
15
27
  ```
16
28
 
@@ -36,7 +48,7 @@
36
48
 
37
49
  content_tag(:td, class: 'should-document-send pb-3') do
38
50
 
39
- concat content_tag(:input, '', type: 'checkbox', checked: customer.should_document_send,
51
+ concat content_tag(:input, '', type: 'checkbox', checked: customer.document_send,
40
52
 
41
53
  class: 'd-none form-check-input mailing-input d-block', id: "mailing_checkbox_#{customer.id}")
42
54
 

1

あw

2021/09/27 08:06

投稿

tarotarotarotar
tarotarotarotar

スコア41

test CHANGED
@@ -1 +1 @@
1
- form_withをhelperメソッドで書きたい
1
+ form_withをcontent_tagを使って書きたい
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
 
18
18
 
19
- 通常のform_withでは上記のように書きますが、helperファイルを使ってビューを作りたいとき、どう書けばよいかがわかりません。
19
+ 通常のform_withでは上記のように書きますが、helperファイルを使って上記の`form_with`に対応する`input`などの入力欄を作りたいとき、どう書けばよいかがわかりません。
20
20
 
21
21
 
22
22