adds routes to votable comments and debates [#25] [#25]

This commit is contained in:
rgarcia
2015-08-02 13:36:08 +02:00
parent 7a50d2064c
commit 44ae7078ea

View File

@@ -6,9 +6,17 @@ Rails.application.routes.draw do
# You can have the root of your site routed with "root"
root 'debates#index'
concern :votable do |options|
resources :votes, options.merge(only: :create)
end
resources :debates do
resources :votes, only: :create
resources :comments, only: :create
concerns :votable, votable_type: 'debate'
resources :comments, only: :create do
concerns :votable, votable_type: 'comment'
end
end
resource :account, controller: "account", only: [:show, :update]