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

  • Home
  • SEARCH
  • 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 9074529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:39:22+00:00 2026-06-16T18:39:22+00:00

if I have resources :projects root to: projects#index in my routes file would it

  • 0

if I have

resources :projects 
root to: "projects#index"

in my routes file would it be more succinct to do

resource :projects
root to: "projects#index"

or any reason this won’t work because I don’t see anyone doing it

  • 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-16T18:39:23+00:00Added an answer on June 16, 2026 at 6:39 pm

    No, because they’re two different methods that do two different things. resources is meant for when you have more than one of the model object (a plural resource), whereas resource is meant for when it is a singular resource. For this reason, using resource does not create an index route and none of the routes take an ID parameter in the URL. To quote the docs:

    Sometimes, you have a resource that clients always look up without referencing an ID. A common example, /profile always shows the profile of the currently logged in user. In this case, you can use a singular resource to map /profile (rather than /profile/:id) to the show action:

    resource :geocoder
    

    That said, I wouldn’t really consider saving one character “more succinct” anyway.

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

Sidebar

Related Questions

I have a nested resource in my routes.rb like this: map.resources :users, :only =>
I have an Eclipse plugin project that has several file resources that I would
I have project asp.net with namespace test and I'm using resources (files Resource.resx and
Resource dictionary 03-11-2010 10:56 AM | I have two different projects. I linked a
I have successfully implemented slider to my Cocos2D project using this resource . The
I have a couple different applications where this would be helpful, but for the
I am using devise and I have a root pointing home#index , now I
i have added an sqlite libsqlite3.0.dylib into my project's resources as per given in
For my project I have added following line of code in applicaiton.ini resources.layout.layoutPath =
I have some data files in the resources/ folder for my Rubymotion project. How

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.