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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:11:39+00:00 2026-05-18T08:11:39+00:00

My homecontroller has: def about() end And I have a rspec test that does

  • 0

My homecontroller has:

def about()
end

And I have a rspec test that does GET ‘about’ and it fails saying that there is no route that matches.

doesn’t this map all actions in the controller:

resources :home

or do I have to explicitly state each action in the home controller?

  • 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-18T08:11:39+00:00Added an answer on May 18, 2026 at 8:11 am

    resources :home sets up the default RESTful routes – index, show, new, create, edit, update, and destroy. Any additional routes have to be specified. It looks like you’re adding a simple collection route, so you’d specify it like this:

    resources :home
      collection do
        get 'about'
      end
    end
    

    This will give your the route ‘/home/about’. I assume this is Rails 3. If you’re in Rails 2.x, do it like so:

    map.resources :home, :collection => {:about => :get}
    

    And from the command line, you can always see what routes you have available with this command:

    rake routes
    

    I hope this helps!

    EDIT: If you want a default route, you can add this:

    match ':controller(/:action(/:id))'
    

    This is a default route that will match any generic requests.

    FULL ARTICLE: Routing in Rails 3 is its own beast. There have been a lot of questions about it lately, so I’ve created a very detailed article with code samples to help others:

    Routing in Ruby on Rails 3

    I created a companion Rails 3 app that can be downloaded to play around with, as well:

    https://github.com/kconrails/rails3_routing

    If you have any questions, please hit up my site and ask. Thanks!

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

Sidebar

Related Questions

My rspec title test is failing with: 1) HomeController Get 'index should have the
I have an application that has an public 'end user' mode and a 'back
Is it possible to have an AsyncController that has a GET and POST action
My homecontroller has a UserService object that gets wired using spring correctly (it renders
I have an app that has the following in the routes file: namespace admin
I have an MVC3 Razor view which has a link that requires user login
I have a HomeController with an Index action that shows the Index.aspx view. It
In my HomeController I have the following 3 queries, notice that the 3rd one
In my ASP.Net MVC app, I have the following controllers HomeController ExController ExController has
// HomeController.cs [AutoMap(typeof(Test), typeof(TestViewModel))] public ActionResult Index() { var tests = new List<Test>(); tests.Add(new

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.