title: Rails: modify form parameters before modifying the database
body: <p>I'm working on a Rails app that sends data through a form. I want to modify some of the "parameters" of the form <em>after</em> the form sends, but <em>before</em> it is processed.</p>
  
  <p><strong>What I have right now</strong></p>
  
  <pre><code>{"commit"=&gt;"Create",
    "authenticity_token"=&gt;"0000000000000000000000000"
    "page"=&gt;{
      "body"=&gt;"TEST",
      "link_attributes"=&gt;[
        {"action"=&gt;"Foo"},
        {"action"=&gt;"Bar"},
        {"action"=&gt;"Test"},
        {"action"=&gt;"Blah"}
      ]
    }
  }
  </code></pre>
  
  <p><strong>What I want</strong></p>
  
  <pre><code>{"commit"=&gt;"Create",
    "authenticity_token"=&gt;"0000000000000000000000000"
    "page"=&gt;{
      "body"=&gt;"TEST",
      "link_attributes"=&gt;[
        {"action"=&gt;"Foo",
         "source_id"=&gt;1},
        {"action"=&gt;"Bar",
         "source_id"=&gt;1},
        {"action"=&gt;"Test",
         "source_id"=&gt;1},
        {"action"=&gt;"Blah",
         "source_id"=&gt;1},
      ]
    }
  }
  </code></pre>
  
  <p>Is this feasible? Basically, I'm trying to submit two types of data at once ("page" and "link"), and assign the "source_id" of the "links" to the "id" of the "page."</p>