Rails: modify form parameters before modifying the database

I’m working on a Rails app that sends data through a form. I want to modify some of the “parameters” of the form after the form sends, but before it is processed.

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 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.”

How could I implement autocompletion using Swing?

I’m interested in providing an autocompletion box in a JFrame. The triggering mechanism will be based on mnemonics (I think), but I’m not really sure what to use for the “autocompletion box” (I would like results to be filtered as the user presses keys).

How would you implement this? Some sort of JFrame, or a JPopupMenu?

I would like to know how this is implemented, so please don’t post links to available [J]Components.