开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜