“If a controller name is not given, the plural form of
the model name will be used. The model and controller
names may be given in CamelCase or under_score and
should not be suffixed with ‘Model’ or ‘Controller’.
Both model and controller names may be prefixed with a
module like a file path; see the Modules Example for
usage.”
Isn’t this the complete opposite of the whole
singularization philosophy? I thought controllers were
supposed to be singular.
But it doesn’t work anyhow:
generate scaffold Abc
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.include?
Isn’t this the complete opposite of the whole
singularization philosophy? I thought controllers were
supposed to be singular.
Not sure about that. Explain?
But it doesn’t work anyhow:
generate scaffold Abc
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.include?
This bug has been fixed in the next release. Please specify both
model and controller name:
script/generate scaffold Abc Abc
names may be given in CamelCase or under_score and
were
supposed to be singular.
Not sure about that. Explain?
Everything I’ve read in Rails states that tables
should be singularized when creating models and
controllers, e.g. items table → Item controller, Item
model. Seems like the default should be to create a
singular model. Or at least match the inflection of
the controller.
While it’s true that Rails defaults would lead you to have an items
table → Item model, I don’t believe I’ve heard anyone apply the same
convention to controller names. As far as I’ve seen, most people seem
to use singular/plural controller names interchangeably, depending on
the specific case, and what they prefer.
“If a controller name is not given, the plural
usage.”
controllers, e.g. items table → Item controller, Item
convention to controller names. As far as I’ve seen, most people seem
to use singular/plural controller names interchangeably, depending on
the specific case, and what they prefer.
Gabe
“Interchangeably” might have been a poor choice of words; that implies
someone might use both singular and plural forms to refer to the same
controller. Of course, I meant that someone might use the singular
form for one controller name (i.e. ItemsController), and the plural
form for another (i.e. BlogController).
Of course, I meant that someone might use the singular
form for one controller name (i.e. ItemsController), and the plural
form for another (i.e. BlogController).
I prefer the other way around
Plural = ItemsController
Singular = BlogController