removes duplication between debate and proposal suggestions

This commit is contained in:
rgarcia
2016-02-03 19:02:19 +01:00
parent 37012fda5c
commit e4a49f802e
8 changed files with 34 additions and 52 deletions

View File

@@ -30,13 +30,8 @@ module CommentableActions
end
def suggest
@limit = 5
@resources = @search_terms.present? ? resource_model.search(@search_terms) : nil
set_resources_instance
if @resources
@resources_count = @resources.count
@reg_show = 5
render layout: false
end
end
def create

View File

@@ -15,6 +15,7 @@ class DebatesController < ApplicationController
has_orders %w{most_voted newest oldest}, only: :show
load_and_authorize_resource
helper_method :resource_model, :resource_name
respond_to :html, :js
def vote

View File

@@ -14,6 +14,7 @@ class ProposalsController < ApplicationController
has_orders %w{most_voted newest oldest}, only: :show
load_and_authorize_resource
helper_method :resource_model, :resource_name
respond_to :html, :js
def index_customization