I may be totally wrong about what the fields_for method is supposed to
do, but for some reason I thought using it scoped an object around an
association.
For example, I have a User class and when you're creating a new user I
want to use fields_for to add a BillingAddress to the user like so:
I may be totally wrong about what the fields_for method is supposed to
do, but for some reason I thought using it scoped an object around an
association.
For example, I have a User class and when you're creating a new user I
want to use fields_for to add a BillingAddress to the user like so:
to build inputs more like user[billing_address][address_two]
Just because lexically it's 'inside' the first form isn't enough (or
to put things another way, it's hard for code to know about the code
that's calling them). If you want what you describe you need to be
explicit: use f.fields_for