Created
April 6, 2016 02:06
-
-
Save kyleroberthammond/2952f3772d95f1126533794c44870571 to your computer and use it in GitHub Desktop.
Previous Path / Get path helper name of a url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.recognize_path(request.referrer) #=> {:controller => "posts", :action => "show"} | |
prev[:action] #=> "show" | |
prev = Rails.application.routes.recognize_path(request.referrer) | |
prev[:controller] #=> "posts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment