Skip to content

Instantly share code, notes, and snippets.

@vwall
Forked from kulesa/gist:2507892
Created May 2, 2012 18:11
Show Gist options
  • Select an option

  • Save vwall/2578841 to your computer and use it in GitHub Desktop.

Select an option

Save vwall/2578841 to your computer and use it in GitHub Desktop.
nested routes for namespaces
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes", "#{@scope[:shallow_prefix]}", "#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :projects # => config/routes/projects.rb
namespace :admin do
draw :projects # => config/routes/admin/projects.rb
end
root to: 'projects#index'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment