ryanb / nested_form

Rails plugin to conveniently handle multiple models in a single form.
MIT License
1.79k stars 505 forks source link

on clicking link_to_add nested forms not shown in rails #374

Open Hassan9229 opened 8 years ago

Hassan9229 commented 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 %>

I want when I click on add more questions , option fields also appear.

om-nishu-trantor commented 7 years ago

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