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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:33:13+00:00 2026-05-28T07:33:13+00:00

I define each actions in my controller this way (in routes.rb ): resources :home

  • 0

I define each actions in my controller this way (in routes.rb):

  resources :home do
    collection do
      get "home/index"
      get "home/about_me"
      get "home/contact"
    end
  end

If I would use a match for the action about_me, I have to use

      resources :home do
        collection do
          get "home/index"
          get "home/about_me"
          get "home/contact"
        end
      end

      match 'about-me' => 'home#about_me'

Exist any way, how to add match rule direct into a collection? I mean something like this:

  resources :home do
    collection do
      get "home/index"
      get "home/about_me", match => "about-me"
      get "home/contact"
    end
  end

And I have one question yet – when I use in the routes.rb the second block of code, so when I set the URL address about-me, so the address works fine, but when I type there home/about_me, so I get the error

Unknown action: The action ‘show’ could not be found for HomeController.

What caused this error?

  • 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-28T07:33:14+00:00Added an answer on May 28, 2026 at 7:33 am

    I think the problem here is that your routes have the home/ prefix when they are nested inside resources :home. Try this:

     resources :home do
       collection do
         get :index
         get :about_me
         get :contact
       end
     end
    

    Also, when you have trouble setting your routes, type rake routes in your console. This will generate the routes of your app and the corresponding paths and controllers.

    EDIT: Here’s the answer to your other question.

    resources :home do
      collection do
        get 'about_me' => 'about-me'
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following in my routes.rb map.resources :novels do |novel| novel.resources :chapters end
I have many cookie-cutter spring beans and don't want to explicitly define each one
For each table in a document, I'd like to define it simple or complicated.
In Mathematica the command Select only lets define a selection criterion for each element
I have a set of lines that define a W shape. On each line
I have a header menu and try to define different CSS classes for each
I just want to know how to define HTML Tag <br clear=all> after each
In a Prism v2 application, I define two regions, each a tabitem in a
There is a hierchy of classes. Each class may define a class variable (to
Okay, guys i have been trying to define a Stack , each node also

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.