# Restful routes, deciding nesting/session

**URL:** <https://www.ruby-forum.com/t/restful-routes-deciding-nesting-session/110164>\
**Category:** Rails\
**Created:** [July 23, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/restful-routes-deciding-nesting-session/110164 "2007-07-23T21:42:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joenova](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@joenova](https://www.ruby-forum.com/u/joenova)\
**Post date:** [July 23, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/restful-routes-deciding-nesting-session/110164/1 "2007-07-23T21:42:18Z")

</div>

I am running edge and am torn on whether to use the nesting of 1.) /  
users/1/books or 2.) /books (and assume current\_user). Also, #1  
allows for /books (without a current user) where #2 does not.

#1 avoids the current\_user restriction (i could log in as an admin and  
not have to switch to a user’s session to edit things, etc), #2 looks  
better

Does anyone have any suggestions or know of anything recent (written  
on close to whats in edge now) that covers this?

Also, if anyone can elaborate on the best-practices of using a  
controller in multiple roles as I hinted at above (/books - no  
current\_user, and /users/1/books) that would be great. I haven’t found  
a good example that shows how one action can behave differently  
depending on the nesting.
