module ActionDispatch::Http::URL

def scheme

Returns 'https' if this is an SSL request and 'http' otherwise.
def scheme
  ssl? ? 'https' : 'http'
end