ministryofjustice / govuk_elements_form_builder

Form builder helper methods to develop GOV.UK elements styled applications in Ruby on Rails
https://govuk-elements-rails-guide.herokuapp.com/
MIT License
6 stars 14 forks source link

Handle fields_for nested more than one level #35

Closed robmckinnon closed 8 years ago

robmckinnon commented 8 years ago

Our current implementation handle fields_for nested inside of a form_for.

Spec fields_for nested inside fields_for behaviour and implement any changes required.

robmckinnon commented 8 years ago

For example, there are several levels of fields_for nesting in this repo, like this:

= f.fields_for :defendants do |defendant|
  # ...
  = f.fields_for :representation_orders do |repo_form|

https://github.com/ministryofjustice/advocate-defence-payments/blob/72e339e0c896059eb04f0ae1ab2244c8fe91c507/app/views/external_users/claims/defendants/_fields.html.haml#L4

https://github.com/ministryofjustice/advocate-defence-payments/blob/72e339e0c896059eb04f0ae1ab2244c8fe91c507/app/views/external_users/claims/defendants/_defendant_fields.html.haml#L25