RailsCasts Pro episodes are now free!
Learn more or hide this
This is too funny. I was halfway through a post on railsforum asking how to do exactly this when my RSS alerted me to a new Railscast. Your timing could not be better!
I'm agree with the first comentary ;)
One way round the AJAX form problem is to have one submit button, and use a "preview" checkbox.
Another great railscast! please keep them coming!
I found the multibutton form can be work only for form_for, but not for form_remote_for
Nice one. I wish this worked with image_submit_tag too.
The name attribute does not not get passed back in the params hash for image_submit_tag
How can I replace submit_tag buttons with link_to or link_to_function?
I want to use multiple link_to_function to replace the submit_tag, to prevent users from accidentally sending a form when press the enter key.
However, I cannot figure out a way to pass :name => 'preview_button' in link_to_function.
This is how I submit a form via link_to_function:
<%= link_to_function('Save', "$('ProductForm').submit()") %>
For those who wanted to try this, keep in mind that this requires that Red Cloth be installed in order to utilize textilize:
. To install it:
gem install RedCloth
To your environment.rb file.
For more information on setting it up, go here:
thx for this article sir
submit_to_remote no longer exist in Rails 3. Just use a submit and do as described in the video.
Was this behavior deprecated at some point?
This episode has been updated for Rails 5 as a blog post. Multi Button Form in Rails 5