# Rails pluralizing when not supposed to?

**URL:** <https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482>\
**Category:** Rails\
**Created:** [February 5, 2007, 7:18am UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482 "2007-02-05T07:18:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [February 5, 2007, 7:18am UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482/1 "2007-02-05T07:18:51Z")

</div>

lo there all.

i am having a strange problem with generating a scaffold.  
everything is pluralized.

for example, if i do a script/generate scaffold Admin ( the example in  
my book )  
instead of admin\_controller.rb i get admins\_controller.rb  
instead of /app/views/admin i get /app/views/admins

is there a configuration setting that i am missing ?

thanks

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [February 5, 2007, 8:31am UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482/2 "2007-02-05T08:31:55Z")

</div>

pluralization is by design.  
try this in your environment.rb do disable pluralization if you need.

ActiveRecord::Base.pluralize\_table\_names = false

HTH

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [February 5, 2007, 2:28pm UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482/3 "2007-02-05T14:28:30Z")

</div>

On Feb 5, 1:30 am, “dweinand” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> pluralization is by design.  
> try this in your environment.rb do disable pluralization if you need.
> 
> ActiveRecord::Base.pluralize\_table\_names = false
> 
> HTH

ok, well, is this something i should do ? should i go with the table  
names pluralized instead of not.  
I mean, if pluralization is by design, should i change that ?

thanks  
sk

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [February 5, 2007, 5:19pm UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482/4 "2007-02-05T17:19:50Z")

</div>

Hi,

Just go with the flow.  
If its a new app and you are in control.  
Who cares if my table is called ‘vehicle’ or ‘vehicles’.  
Check out migrations.

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [February 5, 2007, 9:49pm UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482/5 "2007-02-05T21:49:14Z")

</div>

Controllers and paths should be the plural of the model name,  
so you should be on the right track now.

On Feb 5, 10:23 am, Shawn B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [February 5, 2007, 5:23pm UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482/6 "2007-02-05T17:23:07Z")

</div>

Peter wrote:

> Hi,
> 
> Just go with the flow.  
> If its a new app and you are in control.  
> Who cares if my table is called ‘vehicle’ or ‘vehicles’.  
> Check out migrations.

ok, now my table names are plural,  
i have users, groups, stations, etc…  
so when the scaffold is generated i should have plural controllers ?  
like users\_controller.rb ?  
and /app/views/users/ and so on. this is all ok?  
if so, great, i will not sweat it any more.

thanks for your help

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [February 5, 2007, 10:09pm UTC](https://www.ruby-forum.com/t/rails-pluralizing-when-not-supposed-to/84482/7 "2007-02-05T22:09:18Z")

</div>

On Feb 5, 2:48 pm, “monki” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > If its a new app and you are in control.  
> > > thanks for your help
> 
> > –  
> > Posted viahttp://www.ruby-forum.com/.

way cool, thanks

shawn
