# Resources; how to rename nested url path?

**URL:** <https://www.ruby-forum.com/t/resources-how-to-rename-nested-url-path/123667>\
**Category:** Rails\
**Created:** [December 19, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/resources-how-to-rename-nested-url-path/123667 "2007-12-19T16:48:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [December 19, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/resources-how-to-rename-nested-url-path/123667/1 "2007-12-19T16:48:34Z")

</div>

Hi,

I’ve got some nested resources. I have a model called Feature, and  
FeatureRelation. When I created the standard routes for nesting  
(:has\_many on Feature), I get a path like:

features/1234/feature\_relations

What I’d like is:

features/1234/relations

Is this possible to do? I looked at the API and nothing jumped out at  
me indicating it is?!

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [December 19, 2007, 9:38pm UTC](https://www.ruby-forum.com/t/resources-how-to-rename-nested-url-path/123667/2 "2007-12-19T21:38:42Z")

</div>

On 12/19/07, goodieboy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> features/1234/relations
> 
> Is this possible to do? I looked at the API and nothing jumped out at  
> me indicating it is?!

I don’t believe so with :has\_many, but I think that dropping back to  
less automation and do something like:

map.resource :features do | feature |  
feature.resources :relations, :controller =\> “feature\_relation”  
end

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [December 20, 2007, 5:58am UTC](https://www.ruby-forum.com/t/resources-how-to-rename-nested-url-path/123667/3 "2007-12-20T05:58:48Z")

</div>

See, I was going to say this but he might have many relations. Or he  
could  
just be really bad at naming objects.

This post (and others) is going to serve as the basis of my next  
presentation. Thanks for the inspiration.

On Dec 20, 2007 3:19 PM, Bcp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I’ve got some nested resources. I have a model called Feature, and  
> > me indicating it is?!
> > 
> > Thanks,  
> > Matt
> > 
> > >
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [December 20, 2007, 5:50am UTC](https://www.ruby-forum.com/t/resources-how-to-rename-nested-url-path/123667/4 "2007-12-20T05:50:37Z")

</div>

Instead of feature relation name it as relation

Sent from my iPhone

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [December 21, 2007, 10:54am UTC](https://www.ruby-forum.com/t/resources-how-to-rename-nested-url-path/123667/5 "2007-12-21T10:54:50Z")

</div>

I have made a PATCH which would allow you to do just that…  
[http://dev.rubyonrails.org/ticket/10578](http://dev.rubyonrails.org/ticket/10578)
