# REST path methods problem

**URL:** <https://www.ruby-forum.com/t/rest-path-methods-problem/93194>\
**Category:** Rails\
**Created:** [April 29, 2007, 12:36am UTC](https://www.ruby-forum.com/t/rest-path-methods-problem/93194 "2007-04-29T00:36:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolermaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/43a26b/32.png) [@coolermaster](https://www.ruby-forum.com/u/coolermaster)\
**Post date:** [April 29, 2007, 12:36am UTC](https://www.ruby-forum.com/t/rest-path-methods-problem/93194/1 "2007-04-29T00:36:56Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![coolermaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/43a26b/32.png) [@coolermaster](https://www.ruby-forum.com/u/coolermaster)\
**Post date:** [April 29, 2007, 12:59am UTC](https://www.ruby-forum.com/t/rest-path-methods-problem/93194/2 "2007-04-29T00:59:58Z")

</div>

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
