views:

58

answers:

1

Ruby on Rails has many different generators and other such things. In my experience, the naming is hardly ever obvious though for if you should use a singular or plural name.

For instance for the Controller generator you are suppose to use plural

$ rails generate controller Users new

But for Models you are suppose to use singular(for all names)

$ rails generate model User name:string email:string

Is there a thorough reference guide to which generators and such are using singular names and which ones are plural names?

+2  A: 

You've pretty much got it.

Think of a model as controlling a single thing, so it's singular, and a controller controls a group of things, so it's plural. Scaffolds center around a model, so that's singular just like the model.

Views and helpers are related to the controller, so they're plural. Migrations don't care.

When in doubt, pass --pretend to the generator and see what it will do.

rspeicher
Thanks for the `--pretend` hint
Earlz