ryanb / nested_form

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

Add support for partial option when no block is used with fields_for #310

Open robertwbradford opened 10 years ago

robertwbradford commented 10 years ago

Allow for a :partial option when not using a block in fields_for. Useful when you want to use something besides the "#{association_name.to_s.singularize}fields" partial. For example, if you have a polymorphic association in which the nested fields would be the same throughout the application. It's cleaner than the suggestion here: https://github.com/ryanb/nested_form/issues/167

You simply use something like <%= f.fields_for :tasks, partial: 'tasks/fields' %>