Created
July 11, 2012 20:14
-
-
Save ccschmitz/3093010 to your computer and use it in GitHub Desktop.
An example go_back_btn Rails helper
This file contains 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
def go_back_url(fallback, text = 'Go Back') | |
url = request.referer.blank? | |
url = fallback if url.blank? | |
link_to text, url, class: 'btn' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment