Skip to content

Instantly share code, notes, and snippets.

@DAddYE
Created November 12, 2009 13:08
Show Gist options
  • Save DAddYE/232879 to your computer and use it in GitHub Desktop.
Save DAddYE/232879 to your computer and use it in GitHub Desktop.
Routing
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment