form_test_helper edge gets support for multiple submit buttons 27 Nov 2007
form_test_helper edge has been updated to support multiple submit buttons on a form. It also includes a fix to avoid namespace collisions if models are named Select, Option, etc.

If you have a view which looks like:

<form id="test">
  <input type="submit" value="yes" />
  <input type="submit" value="no" />

You can have choose which value to submit when the form is submitted:

# selecting the form and submitting it in separate steps
form = select_form "test", :submit_value => "yes"

# submitting a form with a submit value in one step
submit_form "test", :submit_value => "yes"

# submitting a form with a submit value in one step using a block
submit_form "test", :submit_value => "yes" do |form|
   # .. 

You don’t have to supply a :submit_value. If you don’t the first submit value found on the form will be used. If you try to supply a non-existent value then an exception will raised.

For example:

# trying to submit on a non-existent input value
form = select_form "test", :submit_value => "fooey"
form.submit  # => raises a FormTestHelper::Form::MissingSubmitError


As an external:

./script/plugin install -x

Not as an external:

./script/plugin install

With piston:

cd vendor/plugins/
piston import


Rdoc pages for form_test_helper edge are hosted on rubyforge. You can find them at “”:

If you have any questions feel free to ask. If you find issues, bugs or odd behavior please create an issue over at “”:

blog comments powered by Disqus