lib/url_for.rb
# Add a secure option to the rewrite method.
Add a secure option to the rewrite method.
Add a secure option to the rewrite method .
def url_for_with_secure_option(options = {})
        secure = options.delete(:secure)
        if !secure.nil? && !SslRequirement.disable_ssl_check?
          if secure == true || secure == 1 || secure.to_s.downcase == "true"
            options.merge!({
              :only_path => false,
              :protocol => 'https'
            })
            unless SslRequirement.ssl_host.nil?
              options.merge! :host => SslRequirement.ssl_host
            end
          else
            options.merge!({
              :protocol => 'http'
            })
          end
        end
        url_for_without_secure_option(options)
      end
def url_for_with_secure_option ( options = { } ) secure = options . delete ( :secure ) if ! secure . nil? && ! SslRequirement . disable_ssl_check? if secure == true || secure == 1 || secure . to_s . downcase == "true" options . merge! ( { :only_path => false , :protocol => 'https' } ) unless SslRequirement . ssl_host . nil? options . merge! :host => SslRequirement . ssl_host end else options . merge! ( { :protocol => 'http' } ) end end url_for_without_secure_option ( options ) end
Add a secure option to the rewrite method.
Add a secure option to the rewrite method .
# if secure && ssl check is not disabled, convert to full url with https # if we've been told to use different host for ssl, use it # make it non-ssl and use specified options
options