Created
September 17, 2012 17:57
-
-
Save slbug/3738781 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
# Code before: | |
resources :messages do | |
resources :comments | |
end | |
resources :posts do | |
resources :comments | |
resources :images, only: :index | |
end | |
# Code after: | |
concern :commentable do | |
resources :comments | |
end | |
concern :image_attachable do | |
resources :images, only: :index | |
end | |
resources :messages, concerns: :commentable | |
resources :posts, concerns: [:commentable, :image_attachable] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment