-
-
Save nesquena/233245 to your computer and use it in GitHub Desktop.
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
namespace :admin do | |
get :show do | |
... | |
end | |
end | |
namespace :frontend do | |
get :index do | |
... | |
end | |
end | |
get :accounts do | |
... | |
end | |
map(:admin, :show).to("/my-admin/:id/show") | |
map(:frontend, :index).to("/") | |
map(:accounts).to("/show-me-my/accounts") | |
# or | |
map :admin do |namespace| | |
namespace.map(:show).to("/my-admin/:id/show") | |
end | |
# and to use | |
link_to "Show Admin", admin_show_path(:id => 5) | |
link_to "FrontEnd", frontend_index_path | |
link_to "Accounts", accounts_path | |
# or maybe | |
link_to "Show Admin", url_for(:admin, :show, :id => 5) | |
link_to "FrontEnd", url_for(:frontend) | |
link_to "Accounts", url_for(:accounts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment