Skip to content

Instantly share code, notes, and snippets.

@joshk
Created July 29, 2010 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshk/497837 to your computer and use it in GitHub Desktop.
Save joshk/497837 to your computer and use it in GitHub Desktop.
Example::Application.routes.draw do |map|
constraints :protocol => "https://" do
get "hi_there", :to => "pages#show", :as => "hi_there"
end
end
>> app.get('http://www.example.com')
>> (ignore the output)
>> app.hi_there_url
=> "http://www.example.com/hi_there"
>> app.get('https://www.example.com')
=> (ignore the output)
>> app.hi_there_url
=> "https://www.example.com/hi_there"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment