Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save achmiral/1075c0f8ed136a6c0be83da87cafd559 to your computer and use it in GitHub Desktop.
Save achmiral/1075c0f8ed136a6c0be83da87cafd559 to your computer and use it in GitHub Desktop.
Rails Conventions - Singular or Plural?
Name Singular/Plural Use
Controller Plural rails g controller Users index show
Helper Plural rails g helper Users
Mailer Singular rails g mailer UserMailer
Migration Plural rails g migration AddEmailToUsers email:string
Model Singular rails g model User name:string
Observer Singular rails g observer User
Resource Plural* resources :users, :only => [:index, :show]
Scaffold Singular rails g scaffold User name:string
Table Plural SELECT * FROM users;
View N/A app/views/users/index.html.erb – comprised of controller (plural) and action (singular)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment