Forum: Ruby on Rails restful routes, deciding nesting/session

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
032fdb4cd4a3c65ebb77846dfa724679?d=identicon&s=25 Joe Noon (joenoon)
on 2007-07-23 21:42
(Received via mailing list)
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

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.
This topic is locked and can not be replied to.