Naming Convention for Controllers?

Hello!

I just read DHH’s presentation pdf.
In his examples, he wrote PeopleController instead of PersonController.
I’ve been using singular words in controller’s name.
Which is more common?

Thanks.
Sam

Luke R. wrote:

Its always made more sense to use plurals to me.

May I ask why?
I’m neutral and just want to gather opinions and will stick to the right
one.

Sam

On Friday, June 30, 2006, at 12:55 AM, Sam K. wrote:

Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

With a plural controller name you end up with URLs like this…

http://localhost/people/edit/1

with singular ones it looks like this…

http://localhost/person/edit/1

The second seems marginally better to me. In particular you need to be
consistent if you use controllers from plugins (like the user_engine).

_Kevin

Kevin O. wrote:

With a plural controller name you end up with URLs like this…

http://localhost/people/edit/1

with singular ones it looks like this…

http://localhost/person/edit/1

The second seems marginally better to me. In particular you need to be
consistent if you use controllers from plugins (like the user_engine).

I thought so, too.
But if the father of Rails takes the other way, it’s really hard to
ignore.
I think that there should be some concensus about this.

Sam

If you want to expose your application’s resources using Rails’
upcoming (in 1.2, I believe) RESTy features, DHH’s recommendation to
pluralize your controller names will probably have significant
benefits in terms of becoming convention.

If you don’t care about RESTful behaviour or producing a Web API for
your app then just use whatever suits your particular application.

  • james

Its always made more sense to use plurals to me.

On 6/29/06, Sam K. [email protected] wrote:


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Cheers,
Luke R.

I never personally liked using same name in model and controllers.

also, when you need to train your team on rails and then get your
projects out quickly(some people always have too many questions :slight_smile: )

I generally used other names like Manageuser instead of User or Users,
cms over article.

I still use whiteboards for team meetings and lots of paper for UI and
prototype, maybe this style suits me

regards
A.Senthil N.
http://senthilnayagam.com

Sam K. wrote:

Hello!

I just read DHH’s presentation pdf.
In his examples, he wrote PeopleController instead of PersonController.
I’ve been using singular words in controller’s name.
Which is more common?

Thanks.
Sam