質問編集履歴
2
あ
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
```erb
|
2
|
-
= form_with
|
2
|
+
= form_with url: messages_create_mailing_label_path do |f|
|
3
|
-
= f.hidden_field :for_yubinbango, value: "Japan", class: "p-country-name"
|
4
|
-
.form-row.mb-2
|
5
|
-
|
3
|
+
%table.mailing_list
|
4
|
+
%tr
|
5
|
+
%th ID
|
6
|
+
%th 対象
|
7
|
+
%th 顧客名
|
8
|
+
%th 発送日
|
9
|
+
%th 支払い
|
6
|
-
|
10
|
+
- mailing_list.each_with_index do |customer, row_num|
|
7
|
-
|
11
|
+
= mailing_data(customer, row_num)
|
12
|
+
%input.btn.btn-primary.ml-auto.mr-4.mt-4.d-block{ type: 'submit', value: 'CSV出力', format: 'csv' }
|
13
|
+
%a{ class: 'd-none', id: 'csv_downloader'}
|
8
14
|
```
|
9
15
|
|
10
16
|
通常のform_withでは上記のように書きますが、helperファイルを使って上記の`form_with`に対応する`input`などの入力欄を作りたいとき、どう書けばよいかがわかりません。
|
@@ -17,7 +23,7 @@
|
|
17
23
|
concat content_tag(:td, customer.id, class: 'mailing-customer-id')
|
18
24
|
concat(
|
19
25
|
content_tag(:td, class: 'should-document-send pb-3') do
|
20
|
-
concat content_tag(:input, '', type: 'checkbox', checked: customer.
|
26
|
+
concat content_tag(:input, '', type: 'checkbox', checked: customer.document_send,
|
21
27
|
class: 'd-none form-check-input mailing-input d-block', id: "mailing_checkbox_#{customer.id}")
|
22
28
|
concat content_tag(:label, '', class: 'mailing-label form-check-label',
|
23
29
|
for: "mailing_checkbox_#{customer.id}")
|
1
あw
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
form_withを
|
1
|
+
form_withをcontent_tagを使って書きたい
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
~
|
8
8
|
```
|
9
9
|
|
10
|
-
通常のform_withでは上記のように書きますが、helperファイルを使って
|
10
|
+
通常のform_withでは上記のように書きますが、helperファイルを使って上記の`form_with`に対応する`input`などの入力欄を作りたいとき、どう書けばよいかがわかりません。
|
11
11
|
|
12
12
|
`f.label`などでformと紐付けるかと思いますが、helperファイルだとどう書けばよいでしょうか?
|
13
13
|
|