Files
2012-02-21 01:15:00 -05:00

1 line
1.5 KiB
JSON

[{"user_id": 8891, "stars": [], "topic_id": 6726, "date_created": 1297913864.979346, "message": "Previously I handled a similar case with a nasty conditional in the action, but since the two calls here have different views, I'd prefer they be separate actions all together. This seems like something that'd be fairly common. Anybody have any recommendations or experiences to share with this sort of thing?", "group_id": 447, "id": 129218}, {"user_id": 8891, "stars": [], "topic_id": 6726, "date_created": 1297913795.9708929, "message": "I'm working on a project that has users and photos. Just as an example, PhotosController#index should show all photos on '/photos', but it should only show a user's photos on '/username/photos'. That's easy to route with a `scope ':username'` and both a nested and non-nested `resources :photos`, but then they're both routing to the same action on the same controller.", "group_id": 447, "id": 129216}, {"user_id": 8224, "stars": [], "topic_id": 6726, "date_created": 1297946667.429774, "message": "The simplest solution is just to add a /:username/photos route to point to a new method in your users controller or photos controller. I don't think there is a magic solution to this, just write some tests and document it.", "group_id": 447, "id": 131242}, {"user_id": 8875, "stars": [], "topic_id": 6726, "date_created": 1298352570.0408471, "message": "a more RESTful solution would be to just use different controllers, you could have the user's one scoped as User::PhotosController", "group_id": 447, "id": 177264}]