The fields_for tag, when working with ActiveResource's
accepts_nested_attributes_for returns the params like this:

"book"=>{"name"=>"sdfas",
"chapters_attributes"=>{"0"=>{"name"=>"sdfaasdf"}}}

Note thé "0" as a key to the "chapters_attributes" hash.

When working with ActiveResource it gives me this 'wrong constant name 0'
because it tries to 'find or create' an resource for each key of the nested
attribute hash.

Someone knows how to fix it? I'm not supposed to use fields_for with
ActiveResource?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/D8r18nldHxwJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 22, '12 at 4:39p
activeFeb 22, '12 at 4:39p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Dimas Cyriaco: 1 post

People

Translate

site design / logo © 2021 Grokbase