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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:26:31+00:00 2026-05-27T14:26:31+00:00

My project name is clog, so I named my models and controllers like this:

  • 0

My project name is clog, so I named my models and controllers like this: Clog::User Clog::Userscontroller.

Is this naming convention mandatory?

  • 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-27T14:26:32+00:00Added an answer on May 27, 2026 at 2:26 pm

    Yes, following the naming convention helps a great deal because not only does rails use it to generate other names, but other gems as well.

    Specific to your question, you may be asking if you need to name the controller as UserController given that your model is called User. That is not necessary at all, and you may call it anything else if it better fits your purpose.

    In this case, you will probably want to create a few controllers like so:

    My::AccountController # for e.g.. /my/account
    Admin::UsersController # for e.g. /admin/users/1
    

    For a user, you refer to your own user record, as ‘your account’ so this makes more sense. However, the administrator’s perspective would be to manage user records. You may also name a controller one thing and serve it under a different route. In your routes file, you may do this:

    namespace :admin do
        resources :users, :path => "user-accounts"
    end
    

    To reiterate, your model name need not match up to the controller name. They are only named similarly by association: UserController is understood to handle User records.

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

Sidebar

Related Questions

I have a table like this table-1 Project-name proj-status ----------- ----------- pro1 progress pro2
I have a line like : <svnbootstrapper LocalWorkingCopy=${projects.dir}/${project.name} Password=4udr=qudafe$h$&e4Rub Username=televic-education /> in my config.xml.
I'd like to access the name of a SBT project that uses a plugin
I have this code: <% @hello = hello world %> <td class=text><%= link_to project.name,
I have this section in my CruiseControl config.xml file: <publishers> <onsuccess> <artifactspublisher dest=artifacts/${project.name} file=projects/${project.name}/fred/>
On my local dev machine this works perfectly: msbuild project.name.csproj /p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir=c:\proyectos\folder1\deploy /p:AutoParameterizationWebConfigConnectionStrings=false
I have the following models: Users (id) Project (id, name) Roles (id, title) Permissions
I have a code part like this in my project : const int cChars
Suppose i started a project name abcd doing this rails new abcd. So some
I have a hash like: h = {'name' => 'sayuj', 'age' => 22, 'project'

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.