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!
d:)
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()") %>
Please help Thanks
For those who wanted to try this, keep in mind that this requires that Red Cloth be installed in order to utilize textilize:
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001748
. To install it:
gem install RedCloth
Then add:
require "RedCloth"
To your environment.rb file.
For more information on setting it up, go here:
http://redcloth.org/
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.
submit_to_remote
submit
thx
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
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!
d:)
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()") %>
Please help
Thanks
For those who wanted to try this, keep in mind that this requires that Red Cloth be installed in order to utilize textilize:
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001748
. To install it:
gem install RedCloth
Then add:
require "RedCloth"
To your environment.rb file.
For more information on setting it up, go here:
http://redcloth.org/
thx for this article sir
submit_to_remoteno longer exist in Rails 3. Just use asubmitand do as described in the video.thx
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