Created
August 2, 2013 17:44
-
-
Save stengland/6141818 to your computer and use it in GitHub Desktop.
External URLs in rails routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp::Application.routes.draw do | |
# External urls | |
scope host: 'www.example.com' do | |
get 'thing' => 'dev#null', as: :thing | |
end | |
end | |
# Use thing_url in your veiws (thing_path would not include the host) | |
# thing_url => "http://www.example.com/thing" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment