Gavin
2007-Oct-24 12:06 UTC
Railscast 73 doesn''t work. Is this an edge problem or am I missing something?
Episode 73 of Ryan Bate''s great series of screencasts shows an example
of using fields_for to create a new record containing two models. I''m
trying to repeat his result but alway get and error from this line:
<% fields_for "ferry[scheduled_port_attributes][]",
scheduled_port
do |sp_form| %>
In the rails cast, this returns an array of scheduled_port_attributes,
but instead I get a hash with "3" as a key:
{"commit"=>"Save",
"ferry"=>{
"scheduled_port_attributes"=>{"3"=>{"departs(4i)"=>"21",
"departs(5i)"=>"29",
"arrives(1i)"=>"2007",
"arrives(2i)"=>"10",
"port_id"=>"2",
"arrives(3i)"=>"12",
"arrives(4i)"=>"21",
"departs(1i)"=>"2007",
"arrives(5i)"=>"29",
"departs(2i)"=>"10",
"departs(3i)"=>"12"}},
"id"=>"1"}}
Am I missing something? I''m on edge rails. Does that matter?
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---