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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:29:43+00:00 2026-05-31T13:29:43+00:00

This is pure curiosity. Let’s say I have a resource Users and want to

  • 0

This is pure curiosity. Let’s say I have a resource “Users” and want to create the standard set of 7 routes for it. In my routes file, I simply enter resources :users. When running rake routes, this is what we get:

     users GET    /users(.:format)           users#index
           POST   /users(.:format)           users#create
  new_user GET    /users/new(.:format)       users#new
 edit_user GET    /users/:id/edit(.:format)  users#edit
      user GET    /users/:id(.:format)       users#show
           PUT    /users/:id(.:format)       users#update
           DELETE /users/:id(.:format)       users#destroy

Is there a specific reason that it’s ordered like this? I understand that the first route that matches the request will be used.

My confusion stems from my thought process that the users#show route would be listed 3rd instead of users#new being in that position.

If anyone could give me some insight into this ordering scheme that would be great.

  • 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-31T13:29:44+00:00Added an answer on May 31, 2026 at 1:29 pm

    There’s no particular reason why these are the way that they are, they just are that way.

    It probably stems from the old (I’m talking 1.2 days here) scaffold controller layout where the actions were laid out in that order.

    The only problem I can imagine you would encounter here is that if you were to have a user with the id of new it would go to UsersController#new first, rather than the ideal UsersController#show. The workaround for that is fairly simple: don’t let users identify themselves as “new”.

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

Sidebar

Related Questions

This question is for pure curiosity. Lets say I have lighttpd installed on my
let's say I got a place_categories.xml file as following, and this is pure xml
This is pure curiosity. Let's write an object: var display = { res1:{ w:640,
I'm trying to solve this problem in a pure-functional way, without using set! .
I have a pure C++ application developed using VC 6.0. I would like this
I have a mild preference in solving this in pure JS, but if the
This is pure curiosity... Most 'professionals' will likely never use Form1 as a valid
This is a question that arose mostly of pure curiosity (and killing some time).
This is PURE HTML. (no php or anything like that, if you want to
I know this is a micro-optimization, so I ask out of pure curiosity. Logically,

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.