Created
June 29, 2012 03:18
-
-
Save semaperepelitsa/3015466 to your computer and use it in GitHub Desktop.
1-to-1 translation of routing_concerns example
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
BCX::Application.routes.draw do | |
def commentable | |
resources :comments | |
end | |
def trashable | |
post :trash, :restore, on: :member | |
end | |
def image_attachable | |
resources :image_attachments, only: :index | |
end | |
resources :calendar_events do | |
commentable | |
get :past, on: :collection | |
end | |
resources :messages, :forwards, :uploads, :documents, :todos do commentable end | |
resources :projects, defaults: { bucket_type: 'project' } do | |
trashable | |
resources :messages, :uploads, :comments do trashable; image_attachable end | |
resources :forwards do | |
trashable; image_attachable | |
get :content, on: :member | |
end | |
resources :todolists do | |
trashable | |
get :more, :completed, on: :collection | |
end | |
resources :todos do | |
trashable | |
post :toggle, on: :member | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment