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 8013973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:47:27+00:00 2026-06-04T19:47:27+00:00

new to web development, here. I have a form like this: <form name=myForm id=myForm

  • 0

new to web development, here. I have a form like this:

<form name="myForm" id="myForm"  method="post" >

      <select id="id" name="foo">
        ...some stuff
      </select>

      <input type="submit"/>
</form>

The submit button calls the ‘index’ method of my controller, as expected. I would like to make it call some other function, such as ‘update’, how do I do that? I need to do something with the @_params hash, but I don’t want invoke the index function, to do it. 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-06-04T19:47:29+00:00Added an answer on June 4, 2026 at 7:47 pm

    You did not include the view logic so I am going to take a stab in the dark and guess you are writing the HTML for the form rather than using the RoR helpers.

    In rails there are a set of helpers that help you generate forms and form items.

    Please check the docs for form_for

    Using form_for will follow the basic restful routing unless you modify the url parameter. So if you are on /new you will be routed to /create, if you are on /edit, you will be routed to /update. More precisely, if the object is new, you will submit to create, if the model exists you will submit to update.

    If your form doesn’t use a model, you can use the form_tag helper that takes a url parameter and you can pass a string specifying what path to submit to.

    If you just need to know how to do this in plain HTML, read this. Essentially, you need to include an action attribute on form that specifies the path to the action you want to post to.

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

Sidebar

Related Questions

I'm new to web development, so I apologize if this question is noobish. I
I am new to web development, I have to create a web application in
I am new to web development. I have 2 .aspx files and in default
I am quite new to web development and have a task to develop a
I'm very new to web development, so bear with me =) Ok here is
I am new to web development, and have found myself stuck on how to
I am very new to web development (about a month) and i have run
I'm new here, and quite new to web development in general. My background is
This is more of a best practices question. I'm doing some front-end web development
I have this form in my view: <!-- Bug (extra 'i') right here-----------v -->

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.