1
1
<%= simple_form_for @project_form, wrapper: 'inline' do |f| %>
2
2
<%= f.input :name, :hint => 'The title of your project' %>
3
3
4
- <ul class ="nav nav-tabs tabs ">
5
- < li class ="active ">
6
- < a href ="#tasks " role ="tab " data-toggle ="tab "> Tasks (:has_many --nested)</ a >
7
- </ li >
8
-
9
- < li >
10
- < a href ="#people " role ="tab " data-toggle ="tab "> People (:has_many)</ a >
11
- </ li >
12
-
13
- < li >
14
- < a href ="#owner " role ="tab " data-toggle ="tab "> Owner (:belongs_to)</ a >
15
- </ li >
16
-
17
- < li >
18
- < a href ="#tags " role ="tab " data-toggle ="tab "> Tags (:has_many :through)</ a >
19
- </ li >
20
- </ ul >
21
-
22
- < div class ="tab-content ">
23
- < div id ="tasks " class ="active ">
24
- <%= f . simple_fields_for :tasks , wrapper : 'inline' do |task | %>
25
- <%= render 'task_fields' , :f => task %>
26
- <% end %>
27
- < div class ="links ">
28
- <%= link_to_add_association 'add task' , f , :tasks , :render_options => { :wrapper => 'inline' } %>
29
- </ div >
4
+ <h3 > Tasks (:has_many --nested)</ h3 >
5
+ < div id ="tasks ">
6
+ <%= f . simple_fields_for :tasks , wrapper : 'inline' do |task | %>
7
+ <%= render 'task_fields' , :f => task %>
8
+ <% end %>
9
+ < div class ="links ">
10
+ <%= link_to_add_association 'add task' , f , :tasks , :render_options => { :wrapper => 'inline' } %>
30
11
</ div >
12
+ </ div >
31
13
32
- < div id =" people " >
33
- <%= f . simple_fields_for :contributors , wrapper : 'inline' do | contributor | % >
34
- <%= render 'contributor_fields' , :f => contributor %>
35
- <% end %>
36
- < div class =" links " >
37
- <%= link_to_add_association 'add contributor' , f , :contributors , :render_options => { :wrapper => 'inline' } % >
38
- </ div >
14
+ < h3 > People (:has_many) </ h3 >
15
+ < div id =" people " >
16
+ <%= f . simple_fields_for :contributors , wrapper : 'inline' do | contributor | %>
17
+ <%= render 'contributor_fields' , :f => contributor %>
18
+ <% end % >
19
+ < div class =" links " >
20
+ <%= link_to_add_association 'add contributor' , f , :contributors , :render_options => { :wrapper => 'inline' } % >
39
21
</ div >
22
+ </ div >
40
23
41
- < div id ="owner ">
42
- < div id ="owner_from_list ">
43
- <%= f . association :owner , :collection => Person . order ( :name ) , :prompt => 'Choose an existing owner' %>
44
- </ div >
45
- <%= link_to_add_association 'add a new person as owner' , f , :owner , :render_options => { :wrapper => 'inline' } %>
24
+ < h3 > Owner (:belongs_to)</ h3 >
25
+ < div id ="owner ">
26
+ < div id ="owner_from_list ">
27
+ <%= f . association :owner , :collection => Person . order ( :name ) , :prompt => 'Choose an existing owner' %>
46
28
</ div >
29
+ <%= link_to_add_association 'add a new person as owner' , f , :owner , :render_options => { :wrapper => 'inline' } %>
30
+ </ div >
47
31
48
- < div id =" tags " >
49
- <%= f . simple_fields_for :project_tags , wrapper : 'inline' do | project_tag | % >
50
- <%= render 'project_tag_fields' , :f => project_tag %>
51
- <% end %>
52
- <%= link_to_add_association 'add a tag' , f , :project_tags , :render_options => { :wrapper => 'inline' } %>
53
- </ div >
32
+ < h3 > Tags (:has_many :through) </ h3 >
33
+ < div id =" tags " >
34
+ <%= f . simple_fields_for :project_tags , wrapper : 'inline' do | project_tag | %>
35
+ <%= render 'project_tag_fields' , :f => project_tag %>
36
+ <% end %>
37
+ <%= link_to_add_association 'add a tag' , f , :project_tags , :render_options => { :wrapper => 'inline' } % >
54
38
</ div >
55
39
56
40
< div class ="actions ">
57
41
<%= f . button :submit , :disable_with => 'Please wait ...' %>
58
42
</ div >
59
- <% end %>
43
+ <% end %>
0 commit comments