
Untitled
By: a guest on
Apr 25th, 2012 | syntax:
None | size: 0.69 KB | hits: 9 | expires: Never
Change protocol to https in all rails helpers
ROUTES_PROTOCOL = (ENV["RAILS_ENV"] =~ /development/ ? 'http://' : 'https://')
scope :protocol => ROUTES_PROTOCOL, :path => "/app" do
YOURAPPNAME::Application.configure do
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
end
if !request.ssl?
"https://" + request.host + request.request_uri
elsif request.ssl?
"http://" + request.host + request.request_uri
end
config.action_mailer.default_url_options = {
:host => 'yourwebsite.com',
:protocol => 'https'
}
# Makes it possible to use image_tag in mails
config.action_mailer.asset_host = "https://yourwebsite.com"