Skip to content

Instantly share code, notes, and snippets.

@ccschmitz
Created July 11, 2012 20:14
Show Gist options
  • Save ccschmitz/3093010 to your computer and use it in GitHub Desktop.
Save ccschmitz/3093010 to your computer and use it in GitHub Desktop.
An example go_back_btn Rails helper
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