Redirect back to user's photo after commenting
The URL for a photo is /use开发者_开发百科rs/1/photos/1
and I want to redirect back to the photo after a comment on that photo has been added.
What should I put after redirect_to
?
Normally something like
redirect_to user_photo_path(@user, @photo)
will work. To verify that the path exists, inside the console you can run rake routes
, and the name of the routes can be used to form the command (by adding the _path
).
Hope this helps.
精彩评论