Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7605933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:17:24+00:00 2026-05-31T00:17:24+00:00

I have a Rails’ remote_form_for that basically changes a value of a field, and

  • 0

I have a Rails’ remote_form_for that basically changes a value of a field, and I want to have 3 buttons. First button is to Save the value of the field. The second button is to Save the value and then call Action1 (e.g. send an email that the field was changed). The third button is to Cancel.

The form is declared with

<% remote_form_for @post,
  :url => { action => 'update_field1', :id => @post.id } do |f| %>

The first button is

<%= f.submit "Save", :disable_with => "Please Wait" %>

How do I implement the Second button? Much thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:17:25+00:00Added an answer on May 31, 2026 at 12:17 am

    So this isn’t really how submit tags work, is the problem with your question. Submit causes the form to submit, and the destination of the submit tag is controlled by the destination of the form, not by the submit button itself. So it doesn’t matter what you put in the submit tag, it’ll always go to the same controller action.

    You can, however, control what the form does based on the submit button in that one controller action. Try something like this in your controller:

    case params[:commit]
    when 'Save' then do_something
    when 'Send Email' then do_something && send_email
    end
    

    Each submit button will send a different commit param, and you can switch what the action does depending on that param.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails model that looks something like this: class Recipe < ActiveRecord::Base
I have a rails form with a datetime_select field. When I try to submit
I have a rails app that I have serving up XML on an infrequent
I have Rails 3.1.2 app with a hierarchical relationship that looks like this: Categories
I have Rails polymorphic model and I want to apply different validations according to
I have rails website that shows information from database. And I have ruby script
So I want to have Rails handle locale-specific routes for me, e.g. /en/companies /nl/companies
I want to have a rake task that reads a HAML file and creates
I have rails application that calculates prices of goods and I set prices in
I have a Rails application that unfortunately after a request to a controller, has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.