Hello,

I'm trying to create a complex form with multiple models.

The problem is that the params hash is sent out of order to the
controller, and the data is saved wrong in the database.

What I get is:
 Parameters: {"commit"=>"Cadastrar", "invoice"=>{"mode"=>"in",
"total"=>"34", "items_attributes"=>[{"item"=>"3333333"},
{"quantity"=>"3333333", "item"=>"666666"}, {"price"=>"3333333",
"quantity"=>"666666"}, {"price"=>"4666666"}], "company_id"=>"10"},....

But what I want is:
 Parameters: {"commit"=>"Cadastrar", "invoice"=>{"mode"=>"in",
"total"=>"34", "items_attributes"=>[{"item"=>"3333333",
"quantity"=>"3333333", price"=>"3333333"},{"item"=>"666666",
"quantity"=>"666666","price"=>"666666"}], "company_id"=>"10"},...


Codes are:

Controller: http://pastie.org/334963
Models: http://pastie.org/334965
Views: http://pastie.org/334967

Does anyone know my error?
Any help will be thankfull.

David Sousa
-- 
Posted via http://www.ruby-forum.com/.

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