# Naming Convention for Controllers?

**URL:** <https://www.ruby-forum.com/t/naming-convention-for-controllers/96578>\
**Category:** Rails\
**Created:** [June 29, 2006, 10:29pm UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578 "2006-06-29T22:29:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 29, 2006, 10:29pm UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578/1 "2006-06-29T22:29:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 30, 2006, 12:55am UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578/2 "2006-06-30T00:55:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 30, 2006, 2:25am UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578/3 "2006-06-30T02:25:36Z")

</div>

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

> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

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

[http://localhost/people/edit/1](http://localhost/people/edit/1)

with singular ones it looks like this…

[http://localhost/person/edit/1](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

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 30, 2006, 2:34am UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578/4 "2006-06-30T02:34:17Z")

</div>

Kevin O. wrote:

> With a plural controller name you end up with URLs like this…
> 
> [http://localhost/people/edit/1](http://localhost/people/edit/1)
> 
> with singular ones it looks like this…
> 
> [http://localhost/person/edit/1](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

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 30, 2006, 3:21am UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578/5 "2006-06-30T03:21:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 30, 2006, 12:07am UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578/6 "2006-06-30T00:07:22Z")

</div>

Its always made more sense to use plurals to me.

On 6/29/06, Sam K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Cheers,  
Luke R.

> **[Luke Redpath - Freelance Ruby, Rails and iOS app developer / London / Essex / UK](https://lukeredpath.co.uk/)**
>
> Experienced freelance and contract developer offering Ruby, Rails and iOS app development services for iPhone, iPad and other iOS platforms. Based in Colchester, Essex, London and remote.

> **[AgileEvolved.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=agileevolved.com)**
>
> Own this domain today. We make your shopping experience easy. Friendly and quick customer service.

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 30, 2006, 3:42am UTC](https://www.ruby-forum.com/t/naming-convention-for-controllers/96578/7 "2006-06-30T03:42:39Z")

</div>

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 🙂 )

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](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
