REST path methods problem

When I run:
script/generate scaffold_resource Tranche

I get the following error:
Showing app/views/tranches/index.rhtml where line #24 raised:
undefined local variable or method `new_tranches_path’ for #<#<Class:
0xb6985718>:0xb69856f0>

I have a number of other resources that seem to work fine when
generated the same way–it’s just Tranche that’s creating problems. Is
this some kind of reserved word? Or is there a pluralization issue?

Any help would be appreciated!

Hey,

First of all, when you use new_xxx_path() you should use the singular-
form of xxx, which should be tranche in this case.

However, in the console it’s pretty easy to see that there is a
problem with the singularization of ‘tranches’:

“tranche”.pluralize.singularize #=> “tranch”

Which means that map.resources :tranches will force you to use
new_tranch_path etc.

You can fix this in your map.resources call:

map.resources :tranches, :singular => ‘tranche’

Then you can do: new_tranche_path, edit_tranche_path, tranches_path.

HTH,
Trevor