Hi i got these parameter in the create controller Parameters: {"commit"=>"Create Tip", "authenticity_token"=>"NCrD6MY1zIIBPMSm5sICH7SB+N/g/pc3MxYKnGOt5o0=", "utf8"=>"✓", "tip"=>{"descripcion"=>"asdf", "tip"=>"asdf", "tiptags_attributes"=>{"0"=>{"tags_id"=>"1"}}}} so i get these @tip = Tip.new(params[:tip]) puts "Printing @tip[:tiptags_attributes] " =nil puts @tip.attribute_names descripcion tip nil so how i can get "tiptags_attributes"=>{"0"=>{"tags_id"=>"1"} cause i want to change tags_id, -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
well, i try, try and try again i cant get it params[:tip][:tiptags_attributes][:"0"][:tags_id]=1 whith the code i can change the attribute On Thu, Feb 10, 2011 at 3:59 PM, Lorenzo Brito Morales <lorenzo.brito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi i got these parameter in the create controller > Parameters: {"commit"=>"Create Tip", > "authenticity_token"=>"NCrD6MY1zIIBPMSm5sICH7SB+N/g/pc3MxYKnGOt5o0=", > "utf8"=>"✓", "tip"=>{"descripcion"=>"asdf", "tip"=>"asdf", > "tiptags_attributes"=>{"0"=>{"tags_id"=>"1"}}}} > so > i get these > @tip = Tip.new(params[:tip]) > > > puts "Printing @tip[:tiptags_attributes] " =nil > puts @tip.attribute_names > descripcion > tip > nil > > > so how i can get "tiptags_attributes"=>{"0"=>{"tags_id"=>"1"} > cause i want to change tags_id, >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
If its a nested attribute you dont need to do any of that watch this http://railscasts.com/episodes/196-nested-model-form-part-1 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.