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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:42:48+00:00 2026-06-03T17:42:48+00:00

I need a bit of help with converting routing from Rails 2 to Rails

  • 0

I need a bit of help with converting routing from Rails 2 to Rails 3.

In app/views/layouts/application.html.erb, I have:

<%= link_to "Reports", reports_path %><br>

There is a ReportsController, and in app/views/reports/index.html.erb, I have this:

<%= link_to "Clients With Animals", :action => "getAnimals", :controller => "clients" %>

Then, in config/routes.rb, I have this (Rails 3)

match '/reports' => "reports#index"
match '/clients/getAnimals', to: "clients#getAnimals"

I get this error when I click on the “getAnimals” link on the reports page:

ActiveRecord::RecordNotFound in ClientsController#show
Couldn't find Client with id=getAnimals

I don’t want “getAnimals” to be the ID – I want it to be the action, instead.

How do I do that?

  • 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-03T17:42:49+00:00Added an answer on June 3, 2026 at 5:42 pm

    Assuming you also have a resources :clients entry, you want to make sure match '/clients/getAnimals', to: "clients#getAnimals" is above it (Rails will match whatever it hits first).

    However, the better way may be to put it in the resource:

    resources :clients do
      get 'getAnimals', :on => :collection
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a bit of help getting the values from these HTML elements with
I need a bit of help from any of the coders out there..... Currently,
I need a bit of help with some Ruby array jujitsu. I have the
I need a bit of help; I'm helping a friend port a Delphi app
I need little bit help related to android tabhost. I have 3 tabs and
Need a bit of help with a form. I have created a form which
I need a litte bit help. I have the following two URLS: WSDL: https://amsel.dpwn.net/abholportal/gw/lp/schema/1.0/var3ws.wsdl
I need help converting this bit of T-SQL into an ActiveRecord Query select entry
I need a bit of help with this javascript code. I have this code:
I'm relatively new to QML and need a bit of help. I have to

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.