Skip to content

Instantly share code, notes, and snippets.

@stengland
Created August 2, 2013 17:44
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stengland/6141818 to your computer and use it in GitHub Desktop.
Save stengland/6141818 to your computer and use it in GitHub Desktop.
External URLs in rails routes
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