bragi / representations

Simple representations for ActiveRecord models
MIT License
7 stars 2 forks source link

Editing form creates additional record instead of updating existing one #26

Open asok opened 15 years ago

asok commented 15 years ago

When someone wants to edit existing user in the test application and clicks ok, the new task is created and added to tasks instead of updating existing ones. The reason of this is hash parameters passed to controller from view: {"commit"=>"ok", "authenticity_token"=>"ISoWFJusyNkCQBxN4cl4B2rRGayYLf3CewRqB/C6O2g=", "id"=>"13", "user"=>{"nick"=>"6 november", "tasks_attributes"=> {"40"=> {"title"=>"", "due_to(1i)"=>"2009", "due_to(2i)"=>"3", "due_to(3i)"=>"6", "description"=>""}}}} the number 40 as the key is an id of the editing task. But it does not do the trick. Good idea would be to try and see how native rails helpers handle editing nested attributes.

asok commented 14 years ago

This should be fixed but need testing. If someone wants to test it please add the comment "working on it" or something like this. Feel free to contact me if you have any questions.