开发者

Finding the calling controller/action in Rails

开发者 https://www.devze.com 2023-01-09 11:49 出处:网络
Like request.referer, I want to know from which controller/action the user is coming from. Is there a method do to this? All I开发者_开发问答 could think of is to use a flash, any better method?Rails.

Like request.referer, I want to know from which controller/action the user is coming from. Is there a method do to this? All I开发者_开发问答 could think of is to use a flash, any better method?


Rails.application.routes.recognize_path(request.referer)[:action]

0

精彩评论

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