Open Hassan9229 opened 8 years ago
Using nested_forms in rails for association forms.
Survey model
has_many :questions
Question model
has_many :options
In survey form when I click on
<%= f.link_to_add "Add More Questions", :questions %>
Question fields open but options fields not open.It open by click on <%= question.link_to_add "Add more options", :options %>
<%= question.link_to_add "Add more options", :options %>
I want when I click on add more questions , option fields also appear.
As mentioned here: https://github.com/ryanb/nested_form#usage To be able to use this gem, you'll need to add accepts_nested_attributes_for :questions
accepts_nested_attributes_for :questions
Using nested_forms in rails for association forms.
Survey model
has_many :questions
Question model
has_many :options
In survey form when I click on
<%= f.link_to_add "Add More Questions", :questions %>
Question fields open but options fields not open.It open by click on
<%= question.link_to_add "Add more options", :options %>
I want when I click on add more questions , option fields also appear.