Thanks, Colin.
I tried what you suggested like this (with quotes around the number),
and it worked.

params[:transport][:transports_transits_attributes][:"0"][:city] ==>
gets me "Seattle" from the initial example.

The problem I have now is that the numbers ("0" and "1246482280809")
are auto-assigned, so I don't know how I would access them then.  The
first one always seem to get "0", but there can be many more
transports_transits for one transport, and all but the first will get
a random number assigned.  Is there a way I can access them without
referring to these numbers?  For example, I can get the length of the
array like this:

len = params[:transport][:transports_transits_attributes].length

and I would love to be able to iterate through the array like this
(sorry for the bad syntax, but you get the idea..):

for (int i=0; i<len; i++)
  params[:transport][:transports_transits_attributes](i)[:city]

but I can't seem to do that.  Any suggestions?
Thanks!
Kumi

--~--~---------~--~----~------------~-------~--~----~
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