Strange scaffolding bug for Rails 2.3.2

Hello!

This is my first post, so plz be patient :slight_smile:
I discovered a strange bug in Rails 2.3.2:
Tested with various DB-Configs (SQLite 3 & MySQL)

Just create a new & fresh rails app and generate a scaffold like this:

ruby script/generate scaffold koerperpartie name:string

and run rake db:migrate and rake:test

--> there seems to be a problem with "koerperpartie_path"

I can reproduce this error on others systems too.

btw "koerperpartie" means "bodypart" :wink:

greetz

thomas jansing

Hello!

This is my first post, so plz be patient :slight_smile:
I discovered a strange bug in Rails 2.3.2:
Tested with various DB-Configs (SQLite 3 & MySQL)

Just create a new & fresh rails app and generate a scaffold like this:

ruby script/generate scaffold koerperpartie name:string

and run rake db:migrate and rake:test

--> there seems to be a problem with "koerperpartie_path"

I'm guessing at what the problem is since I haven't tried this (tip
for next time: describe exactly what it is that didn't work), but my
money would be on rails incorrectly pluralizing/singularizing your non
english model name.

Fred

You got that right (of course) Fred

"rake routes"

   koerperparties GET /koerperparties(.:format)
{:action=>"index", :controller=>"koerperparties"}
                  POST /koerperparties(.:format)
{:action=>"create", :controller=>"koerperparties"}
new_koerperparty GET /koerperparties/new(.:format)
{:action=>"new", :controller=>"koerperparties"}
edit_koerperparty GET /koerperparties/:id/edit(.:format)
{:action=>"edit", :controller=>"koerperparties"}
     koerperparty GET /koerperparties/:id(.:format)
{:action=>"show", :controller=>"koerperparties"}
                  PUT /koerperparties/:id(.:format)
{:action=>"update", :controller=>"koerperparties"}
                  DELETE /koerperparties/:id(.:format)
{:action=>"destroy", :controller=>"koerperparties"}
                         /:controller/:action/:id
                         /:controller/:action/:id(.:format)

Before issuing the "script/generate scaffold..." command add this to
"config/initializers/inflections.rb":

ActiveSupport::Inflector.inflections do |inflect|
  inflect.irregular 'koerperpartie', 'koerperparties' # or whatever
the plural really is
end

Then "script/generate scaffold..." and the following "rake
db:migrate", "rake test" will make you smile...