How to write a hash for a nested form??

Example form fields (main model is Practice, nested is User):
practice[name]
practice[users_attributes][0][email]

I want to do this:

post:
  post :create, :practice => { :name => "any name", :users_attributes => {
:0 => { :email => "[email protected]" } } }

The issue is that I can not create a symbol for 0 - :0 and :0.to_sym don't
work and "0".to_sym and '0'.to_sym give me the weird :"0". So how can I hack
this through? Is there another way to create such a hash which bypasses need
for symbols which the controller will still understand?

Thanks,

David

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to