This is my nested_form:
..
...
54 <div>
55 <h2> Address </h2>
56 <%= f.fields_for :address do |address_form| %>
57 <%= address_form.text_field :country %>
58 <% end %>
59 </div>
60
61 <div>
62 <h2> Participants </h2>
63 <%= f.fields_for :participants do |participant_form| %>
64 <%= participant_form.text_field :name %>
65 <%= participant_form.link_to_remove "Remove this participant" %>
66 <% end %>
67 <p><%= f.link_to_add "Add a participant", :participants %></p>
68 </div>
...
..
Now when I visit my model/new page it does not render any fields for address or participants.
This is my model:
1 class CompetitionEntry < ActiveRecord::Base
2 has_many :participants
3 has_one :address
4 has_many :music_programs
5
6 accepts_nested_attributes_for :address
7
8 accepts_nested_attributes_for :participants, :music_programs,
9 :allow_destroy => true,
10 :reject_if => :all_blank
11 end
This is my controller:
16 def new
17 @competition_entry = CompetitionEntry.new
18 end
Why is it happening ? did I miss something?