From 44ae7078ea95d78b5c9fbc565a38378fc9275819 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sun, 2 Aug 2015 13:36:08 +0200 Subject: [PATCH] adds routes to votable comments and debates [#25] [#25] --- config/routes.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index f5afd988c..58e23310d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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]