For a simple route with names
map.namespace :api do |api|
api.resources :genres
end
how can i reuse this block, but with a different namespace?
I am currently achieving this by writing another route hacked on the fly
map.with_options :name_prefix => 'mobile_', :path_prefix => 'mobile' do |mobile|
mobile.resources :genres, :controller => 'api/genres'
end
But he seems less than ideal.
source
share