npprmiwkmkiwau7
npprmiwkmkiwau7

Reputation: 11

Finding the calling controller/action in 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?

Upvotes: 1

Views: 956

Answers (1)

Hemanth M C
Hemanth M C

Reputation: 436

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

Upvotes: 5

Related Questions