Skip to content

Instantly share code, notes, and snippets.

@stevenwilkin
Forked from dhh/gist:2492118
Created May 3, 2012 17:49
Show Gist options
  • Save stevenwilkin/2587565 to your computer and use it in GitHub Desktop.
Save stevenwilkin/2587565 to your computer and use it in GitHub Desktop.
How DHH tamed the 500-line routes.rb file in the new Basecamp
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
draw :people_and_groups
draw :projects
draw :calendars
draw :legacy_slugs
draw :ensembles_and_buckets
draw :globals
draw :monitoring
draw :mail_attachments
draw :message_preview
draw :misc
root to: 'projects#index'
end
@h0jeZvgoxFepBQ2C
Copy link

Yeah, doesn't work for me either in dev env.. Did you found a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment