Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # examples of rails 4 routes concerns
  2. concern :commentable do
  3. resources :comments
  4. end
  5.  
  6. concern :image_attachable do
  7. resources :images, only: :index
  8. end
  9.  
  10. resources :messages, concerns: :commentable
  11.  
  12. resources :posts, concerns: [:commentable, :image_attachable]
  13.  
  14. concern :printable do
  15. member do
  16. post :print
  17. end
  18. end
  19.  
  20. resources :pamphlets, concerns: :printable
  21.  
  22. resources :posters, concerns: :printable do
  23. collection do
  24. post :bulk_print
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement