displays the top 3 proposals for every category

This commit is contained in:
rgarcia
2016-02-16 12:17:37 +01:00
parent 09c1c5e089
commit 6540092bcd
5 changed files with 38 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ class ProposalsController < ApplicationController
before_action :set_search_order, only: :index
before_action :load_categories, only: [:index, :new, :edit, :map]
before_action :load_geozones, only: [:edit, :map]
before_action :authenticate_user!, except: [:index, :show, :map]
before_action :authenticate_user!, except: [:index, :show, :map, :summary]
has_orders %w{hot_score confidence_score created_at relevance}, only: :index
has_orders %w{most_voted newest oldest}, only: :show
@@ -35,6 +35,10 @@ class ProposalsController < ApplicationController
set_featured_proposal_votes(@proposal)
end
def summary
@proposals = Proposal.grouped_by_categories(Proposal.category_names)
end
private
def proposal_params