Skip to content

Instantly share code, notes, and snippets.

@semaperepelitsa
Created June 29, 2012 03:18
Show Gist options
  • Save semaperepelitsa/3015466 to your computer and use it in GitHub Desktop.
Save semaperepelitsa/3015466 to your computer and use it in GitHub Desktop.
1-to-1 translation of routing_concerns example
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