This project is archived and is in readonly mode.

#3930 ✓resolved
Christoph Olszowka

Uncountable inflections lead to exception with Rails 3 scaffolding

Reported by Christoph Olszowka | February 11th, 2010 @ 12:00 PM | in 3.0.2

On a vanila Rails 3 beta1 app as well as on edge, when you generate a scaffold based upon an uncountable word you'll get a routing error.

That's what I did:
rails g scaffold fish name:string

When going to http://localhost:3000/fish/new, I'll get:

ActionController::RoutingError in Fish#new
Showing (...)/app/views/fish/_form.html.erb where line 1 raised:
No route matches {:action=>"destroy", :controller=>"fish"}

Extracted source (around line 1):
1: <% form_for(@fish) do |f| %>

The same happens for sheep (which, like fish, obviously is included in the active support inflector defaults) or other uncountable words I put in the inflection initializer. I also get a warning when running the generator:
Plural version of the model detected, using singularized version. Override with --force-plural.

Adding that option fixes the warning, but not the generated code.

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>

Referenced by

Pages