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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:16:21+00:00 2026-05-27T22:16:21+00:00

Why controllers are named users_controller.rb and models are not named user_model.rb? Why there is

  • 0

Why controllers are named “users_controller.rb” and models are not named “user_model.rb”?

Why there is “application_controller.rb” but inside views the folder “layout” is not named “application”?

  • 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-27T22:16:22+00:00Added an answer on May 27, 2026 at 10:16 pm

    Code flows from thought best when the naming supports the developers internal model of the problem. When building an application, I don’t think of finding a user model (UserModel.find) I think of finding a user (User.find). On the other hand, the controllers are the translation layer between the web interface and the data store (and business logic), so it makes more sense to call them something different.

    There’s also the problem of namespacing; if both my model and controller are named User, then which User am I referring to at any given moment? In this case, either you name everything with their type, which runs into the problem I describe above, or one ‘wins’ and is allowed to be referenced ‘bare’. It seems to make the most sense that the model would win, so as to provide a better mental mapping.

    Inside app/views/layout is application.html.erb and you can have other layouts which are selected by different controllers.

    In the end, however, these were choices made during the development of Rails, and they are entirely stylistic choices based on what the developers thought made the most sense, so there isn’t really a ‘right’ answer to your question, unfortunately. In fact, some similar decisions have been revisited. (application_controller.rb used to just be named application.rb.)

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

Sidebar

Related Questions

REWROTE: SOLVED Hi there, I currently worked on a simple application with a database,
There are many similar questions, but I couldn't find exactly how to use a
I am developing an application using MVC Preview 5. I have used typed views.
I'm getting this error intermittently on my MVC 2 web application. My models do
I am using the Zend Framework. I have a controller named 'UserController' that has
I have a controller named Content, which has an Index action, which is associated
I have two view controllers name RootViewController and SecondViewController. In the FirstViewController I have
I have a controller/model hypothetically named Pets. Pets has the following declarations: belongs_to :owner
If i put an object named foo into model in Spring controller, and want
I am writing a Controller for Codeigniter with a method named print. The name

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.