Skip to content

Instantly share code, notes, and snippets.

@reconbot
Created February 10, 2014 18:21
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 reconbot/8921331 to your computer and use it in GitHub Desktop.
Save reconbot/8921331 to your computer and use it in GitHub Desktop.
I want to link to things that have routes that are constrained by a host by using their path helper.
<%= link_to "Second App", my_app_two_path %>
MyApp::Application.routes.draw do
get '/', to: "static_pages#my_app_one", constraints: { host: ENV["MY_APP_ONE_DOMAIN"] }, as: :my_app_one
get '/', to: "static_pages#my_app_two", constraints: { host: ENV["MY_APP_TWO_DOMAIN"] }, as: :my_app_two
root to: "static_pages#my_app_root"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment