fields_for should not add an "_attributes" suffix #940

Closed
postmodern opened this Issue Oct 9, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

postmodern commented Oct 9, 2012

I noticed that fields_for suffixed the nested attributes key with _attributes. This makes it incompatible with ORMs that accept nested attributes (ex: DataMapper). Ideally, no suffix should be added.

Member

dariocravero commented Jan 2, 2013

This might have stayed there because of ActiveRecord, since that's the way it handles nested attributes. I agree with you that it should be changed, particularly if you're dealing with other ORMs that support direct nesting of relations. I'm working on a patch for this and will push it for you to review it as soon as I can.

dariocravero was assigned Jan 5, 2013

Contributor

postmodern commented Jan 31, 2013

Looks like I have to use dm-accepts_nested_attributes, which adds _attributes= methods.

postmodern closed this Jan 31, 2013

Member

dariocravero commented Jan 31, 2013

That's definitely an easier solution. I've added the explanation to the docs here. Perhaps we should think of adding it for the rest of the ORMs at some point...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment