# Resource routes where singular and plural are the same

**URL:** <https://www.ruby-forum.com/t/resource-routes-where-singular-and-plural-are-the-same/105852>\
**Category:** Rails\
**Created:** [June 3, 2007, 8:41pm UTC](https://www.ruby-forum.com/t/resource-routes-where-singular-and-plural-are-the-same/105852 "2007-06-03T20:41:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parker\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/eada6e/32.png) [@Parker\_T](https://www.ruby-forum.com/u/Parker_T)\
**Post date:** [June 3, 2007, 8:41pm UTC](https://www.ruby-forum.com/t/resource-routes-where-singular-and-plural-are-the-same/105852/1 "2007-06-03T20:41:47Z")

</div>

I have a question regarding routes for resources that have the same  
name in the singular and plural. For example, if I have:

map.resources :series do |series|  
series.resources :characters  
end

then ‘new\_series\_url’ generates ‘/series/new’, however I get the  
following error when I hit that url:

series\_url failed to generate from {:action=\>“show”,  
:controller=\>“series”} - you may have ambiguous routes, or you may  
need to supply additional parameters for this route. content\_url has  
the following required parameters: [“series”, :id] - are they all  
satisifed?

I’m presuming here it assumes I want the url for an existing series.  
I am able to create series if I use a singleton resource, e.g.:

map.resources :series

however, this fouls up the nesting of my characters resource causing  
‘new\_character\_url(:series\_id =\> @series)’ to generate the following  
url:

[http://localhost:3000/series/characters/new?series\_id=16](http://localhost:3000/series/characters/new?series_id=16)

which makes some sense, as I’ve now said series is a singleton  
resource. So, my question is how do I disambiguate between series  
(plural) and series (singular) when using non-singleton resources and  
generated url helpers to get properly nested resources?

Thanks,

pt.

---

<div class="post-metadata">

**Author:** ![Parker\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/eada6e/32.png) [@Parker\_T](https://www.ruby-forum.com/u/Parker_T)\
**Post date:** [June 4, 2007, 4:27am UTC](https://www.ruby-forum.com/t/resource-routes-where-singular-and-plural-are-the-same/105852/2 "2007-06-04T04:27:29Z")

</div>

Hey,

I explain how here:

[http://somethinglearned.com/articles/2007/03/19/how-to-uncountable-names-in-restful-routes](http://somethinglearned.com/articles/2007/03/19/how-to-uncountable-names-in-restful-routes)

HTH,  
Trevor

On 6/3/07, Parker T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks,
> 
> pt.
> 
> >

## –

Trevor S.  
[http://somethinglearned.com](http://somethinglearned.com)
