Created
February 10, 2014 18:21
-
-
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.
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
<%= link_to "Second App", my_app_two_path %> |
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 | |
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