I am working on a Rails application that submits data through a form. I want to change some "parameters" of the form after submitting the form, but before processing it.
What I have right now
{"commit"=>"Create", "authenticity_token"=>"0000000000000000000000000" "page"=>{ "body"=>"TEST", "link_attributes"=>[ {"action"=>"Foo"}, {"action"=>"Bar"}, {"action"=>"Test"}, {"action"=>"Blah"} ] } }
What I want
{"commit"=>"Create", "authenticity_token"=>"0000000000000000000000000" "page"=>{ "body"=>"TEST", "link_attributes"=>[ {"action"=>"Foo", "source_id"=>1}, {"action"=>"Bar", "source_id"=>1}, {"action"=>"Test", "source_id"=>1}, {"action"=>"Blah", "source_id"=>1}, ] } }
Is it possible? Basically, I try to send two types of data at once ("page" and "link") and assign "source_id" from the "links" to the "id" on the page.
ruby ruby-on-rails activerecord
Adam rezich
source share