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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:42:28+00:00 2026-05-25T19:42:28+00:00

In RoR 3, I just want to have a link/button that activates some action/method

  • 0

In RoR 3, I just want to have a link/button that activates some action/method in the controller. Specifically, if I click on a ‘update_specs’ link on a page, it should go to ‘update_specs’ method in my products controller. I’ve found suggestions to do this on this site:

link_to "Update Specs", :controller => :products, :action => :update_specs

However, I get the following routing error when I click on this link:

Routing Error No route matches {:action=>”update_specs”,
:controller=>”products”}

I’ve read up on routing but I don’t understand why I should have to route this method if all other methods are accessible via resources:products.

  • 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-25T19:42:29+00:00Added an answer on May 25, 2026 at 7:42 pm

    You need to create a route for it.

    For instance:

    resources :products do
      put :update_specs, :on => :collection
    end
    

    Also by default link_to will look for a GET method in your routes. If you want to handle a POST or PUT method you need to specify it by adding {:method => :post } or {:method => :put } as a parameter, like:

    link_to "Update Specs", {:controller => :products, :action => :update_specs}, {:method => :put }
    

    Or you can use button_to instead of link_to which handles the POST method by default.

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

Sidebar

Related Questions

I've been programming for many years and have just recently got the RoR itch.
I only want facts as far as possible. There are some things that ASP.Net
Just starting to learn Ruby on Rails. I'm using RoR 3. I have read
I have just completed the introduction guide to RoR: http://guides.rubyonrails.org/getting_started.html . It's a great
I have a RoR server that I am decommissioning and need to move the
I was just reading up on ROR (haven't dived into it yet), and I
I am developing RoR application that works with legacy database and uses ActiveScaffold plugin
Im starting to learn RoR and i want to make my personal blog in
All of the tutorials I've seen so far for RoR have shown me generating
RoR is famous for being convention over configuration, so it's likely that my question

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.