app/controllers/application_controller.rb
# send user to the SSL version of the page (used in the account controller, can be used elsewhere)
send user to the SSL version of the page (used in the account controller, can be used elsewhere)
send user to the SSL version of the page ( used in the account controller can be used elsewhere )
def redirect_to_ssl
    url_to_return = params[:return_to] ? CGI.unescape(params[:return_to]).strip : nil
    unless request.ssl? || local_request?
      if url_to_return && url_to_return[0...1] == '/'  
        redirect_to protocol: "https://", return_to: url_to_return, method: request.method, status: :moved_permanently
      else
        redirect_to protocol: "https://", method: request.method, status: :moved_permanently
      end
    end
  end
def redirect_to_ssl url_to_return = params [ :return_to ] ? CGI . unescape ( params [ :return_to ] ) . strip : nil unless request . ssl? || local_request? if url_to_return && url_to_return [ 0 ... 1 ] == '/' redirect_to protocol : "https://" , return_to : url_to_return , method : request . method , status : :moved_permanently else redirect_to protocol : "https://" , method : request . method , status : :moved_permanently end end end
send user to the SSL version of the page (used in the account controller, can be used elsewhere)
send user to the SSL version of the page ( used in the account controller can be used elsewhere )
#return to local url