This project is archived and is in readonly mode.

#4980 ✓resolved
Andrew White

Resource controller name pluralization regression

Reported by Andrew White | June 26th, 2010 @ 08:24 AM | in 3.0.2

In Rails 2.3 the controller name is not forced to be a plural in a map.resources call, e.g:

map.resources :content

creates routes like this:

andyw$ rake routes
             GET    /content(.:format)          {:action=>"index", :controller=>"content"}
    contents POST   /content(.:format)          {:action=>"create", :controller=>"content"}
 new_content GET    /content/new(.:format)      {:action=>"new", :controller=>"content"}
             GET    /content/:id(.:format)      {:action=>"show", :controller=>"content"}
             PUT    /content/:id(.:format)      {:action=>"update", :controller=>"content"}
     content DELETE /content/:id(.:format)      {:action=>"destroy", :controller=>"content"}
edit_content GET    /content/:id/edit(.:format) {:action=>"edit", :controller=>"content"}

Whereas in 3.0:

resources :content

creates routes like this:

andyw$ rake routes
             GET    /content(.:format)          {:controller=>"contents", :action=>"index"}
    contents POST   /content(.:format)          {:controller=>"contents", :action=>"create"}
 new_content GET    /content/new(.:format)      {:controller=>"contents", :action=>"new"}
             GET    /content/:id(.:format)      {:controller=>"contents", :action=>"show"}
             PUT    /content/:id(.:format)      {:controller=>"contents", :action=>"update"}
     content DELETE /content/:id(.:format)      {:controller=>"contents", :action=>"destroy"}
edit_content GET    /content/:id/edit(.:format) {:controller=>"contents", :action=>"edit"}

The attached patch restores this behaviour.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages