Padrino supports the idea of nested routes. Here's one example from the documentation:
SimpleApp.controllers :product, :parent => :user do
get :index do
# "/user/#{params[:user_id]}/product"
end
get :show, :with => :id do
# "/user/#{params[:user_id]}/product/show/#{params[:id]}"
end
end
However, what I'd like is to be able to have the following mappings:
GET /users # '/' in :users controller
GET /users/:id # '/:id' in :users controller
GET /users/:user_id/tweets # '/' in :tweets controller
GET /users/:user_id/tweets/:id # '/:id' in :tweets controller
GET /tweets # '/' in :tweets controller, too
GET /tweets/:id # '/:id' in :tweets controller, too
Is that possible?