[Rails] Pluralization Confusion(s)

Brian L. zorander at gmail.com
Tue Feb 1 05:14:26 GMT 2005


Well I'm not authoritative, but I'll give it a shot and perhaps
someone will back me up.

It seems that the closest aproximation to a consensus is to use
singular models (in fact AR seems to strongly encourage this) and
pluralized controllers.

The reasons for the varying codebases out there are, I think, mostly
historic. The generators/new_scaffold scripts have done it both ways
within the past month or so (rails is a bit of a moving target :). I'm
sure a few people prefer it either way and even more have gotten into
the habit of one or another based on the scripts being that way when
they started their project.

In short, singular models are all but required to make AR happy and
controllers are up to you, but I (and most everyone I've run into, and
the generators) prefer to use plurals for controllers.

Brian


On Mon, 31 Jan 2005 22:48:26 -0500, Alexander Payne <al3x at al3x.net> wrote:
> Could somebody please answer Carl Youngblood's question
> (http://thread.gmane.org/gmane.comp.lang.ruby.rails/2105) from January
> 26th definitively?  To quote his message:
> 
> "For the time being, which usage is more common for naming controllers
> and models?  Do you like to put the object being operated on in singular
> or plural?"
> 
> In looking through other people's Rails applications I see that models
> are consistently in the singular (which makes good sense), but I've
> seen controllers and their corresponding views in both the singular and
> plural.  Which is to say I've seen both:
> 
> http://www.hotstuffonrails.egg/post/view/42
> 
> ... and ...
> 
> http://www.hotstuffonrails.egg/posts/view/42
> 
> Is one correct?  Is the pluralization that `script/generate scaffold
> Post` decides on correct?  An authoritative answer, please!
> 
> Advance thanks,
> al3x
> 
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
> 


-- 
The years ahead pick up their dark bags.
They move closer. There's a slight rise in the silence

then nothing.
--
(If you're receiving this in response to mail sent to
bluczkie at andrew.cmu.edu, don't be concerned This is my new address,
but mail will be forwarded here indefinitely)


More information about the Rails mailing list