質問編集履歴
2
fff
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,53 +1 @@
|
|
1
|
-
ここのサイト([Ruby on Railsで動的に追加・削除可能な入力フォームの実装手順](http://www.virment.com/add_and_remove_rails_nested_form_dynamically/))を参考に、「nested_form_fields」というgemを使って動的に追加・削除可能な入力フォームを作りました。
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
ここの部分のviewは下のようになっています。
|
6
|
-
|
7
|
-
```html.erb
|
8
|
-
|
9
|
-
<table class="table table-striped table-bordered table-hover">
|
10
|
-
|
11
|
-
<thead>
|
12
|
-
|
13
|
-
<tr>
|
14
|
-
|
15
|
-
<th></th>
|
16
|
-
|
17
|
-
<th>オプション名</th>
|
18
|
-
|
19
|
-
<th>価格</th>
|
20
|
-
|
21
|
-
<th>備考欄</th>
|
22
|
-
|
23
|
-
</tr>
|
24
|
-
|
25
|
-
</thead>
|
26
|
-
|
27
|
-
<tbody>
|
28
|
-
|
29
|
-
<%= f.nested_fields_for :project_option, wrapper_tag: :tr do |project_option| %>
|
30
|
-
|
31
|
-
<td><% %></td>
|
32
|
-
|
33
|
-
<td><%= project_option.text_field :name, class: 'form-control' %></td>
|
34
|
-
|
35
|
-
<td><%= project_option.number_field :price, class: 'form-control' %></td>
|
36
|
-
|
37
|
-
<td><%= project_option.text_area :remarks, class: 'form-control' %></td>
|
38
|
-
|
39
|
-
<td><%= project_option.remove_nested_fields_link '削除', class: 'btn btn-danger', role: 'button' %></td>
|
40
|
-
|
41
|
-
<% end %>
|
42
|
-
|
43
|
-
</tbody>
|
44
|
-
|
45
|
-
</table>
|
46
|
-
|
47
|
-
```
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaffffffffffffffffffffffffff
|
52
|
-
|
53
|
-
どなたかよい方法をご存じないでしょうか?
|
1
aaa
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
abcd1234567
|
test
CHANGED
File without changes
|