# URL for creating nested resources in REST

**URL:** <https://www.ruby-forum.com/t/url-for-creating-nested-resources-in-rest/92676>\
**Category:** Rails\
**Created:** [April 22, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/url-for-creating-nested-resources-in-rest/92676 "2007-04-22T23:40:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![namelessjon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d78d45/32.png) [@namelessjon](https://www.ruby-forum.com/u/namelessjon)\
**Post date:** [April 22, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/url-for-creating-nested-resources-in-rest/92676/1 "2007-04-22T23:40:59Z")

</div>

Hi all

I have a problem with the url helpers my nested routes are supplying  
(or at least, I think I do). I’m writing a site to help people keep  
track of roleplaying characters, so one user has\_many characters, so  
in routes.rb I have the arrangement like so:

map.resources :user do |user|  
user.resources :character  
end

user\_path(user\_id) works fine for all the REST actions I need for  
users, except for POST.

Likewise, character\_path(user\_id,character\_id) works for GET, PUT, and  
DELETE for all the usual REST actions.

And manually typing in urls like /user and /user/1/character work for  
POST, but I’m sure there should be url helpers for them…

Any pointers would be gratefully appreciated,  
Jon
