Skip to content

Instantly share code, notes, and snippets.

@dsingleton
Last active August 29, 2015 14:17
Show Gist options
  • Save dsingleton/98d105ff1101873cd6ae to your computer and use it in GitHub Desktop.
Save dsingleton/98d105ff1101873cd6ae to your computer and use it in GitHub Desktop.
Rails.application.routes.draw do
concern :scrobbles do
resources :scrobbles, only: [:index]
end
concern :users do
resources :users, only: [:index]
end
concern :tracks do
resources :tracks, only: [:index]
end
resources :scrobbles, only: [:index, :show]
resources :users, only: [:index, :show], concerns: [:scrobbles, :tracks]
constraints(id: /.+/) do
resources :artists, only: [:index, :show], concerns: [:scrobbles, :users] do
resources :tracks, only: [:index, :show], concerns: [:scrobbles, :users]
end
end
root 'home#index'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment