Created
April 25, 2012 18:44
-
Star
(290)
You must be signed in to star a gist -
Fork
(54)
You must be signed in to fork a gist
-
-
Save dhh/2492118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
How can I use concern with this conven?
https://guides.rubyonrails.org/routing.html#routing-concerns
concern :commentable do
resources :comments
end
resources :messages, concerns: :commentable
can I do this?
draw :api, concerns: :commentable
or there another way?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Anyone found a nice solution on how to seperate route files and still make them auto reloading during development?
Edit: Going now with a combination of the mentioned solutions...