Skip to content

Instantly share code, notes, and snippets.

@edlvj
Created June 7, 2019 13:52
Show Gist options
  • Save edlvj/b8e39b66eebae67a603b4d39cf9e8864 to your computer and use it in GitHub Desktop.
Save edlvj/b8e39b66eebae67a603b4d39cf9e8864 to your computer and use it in GitHub Desktop.
def set_back_url
return if request.referer.blank?
if referer_path.include?(city_establishments_path)
session['gcd_back_url'] = referer_path
return
end
if referer_path.eql?(city_grease_traps_path)
session['gcd_back_url'] = city_grease_traps_path
return
end
session['gcd_back_url'] ||= city_grease_traps_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment