Skip to content

Instantly share code, notes, and snippets.

@fermion
Created April 29, 2010 17:46
Show Gist options
  • Save fermion/383947 to your computer and use it in GitHub Desktop.
Save fermion/383947 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