Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PerfectlyNormal/384913 to your computer and use it in GitHub Desktop.
Save PerfectlyNormal/384913 to your computer and use it in GitHub Desktop.
before_filter :ensure_https
def ensure_https
if Rails.env == "production" && !request.ssl?
redirect_to "https://" + request.host + request.request_uri
flash.keep
return false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment