Adds recommendations on proposals index

This commit is contained in:
decabeza
2018-03-28 01:40:51 +02:00
committed by Angel Perez
parent 36a5ff39b8
commit bdb3f30e40
6 changed files with 29 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ class ProposalsController < ApplicationController
before_action :authenticate_user!, except: [:index, :show, :map, :summary]
before_action :destroy_map_location_association, only: :update
before_action :set_view, only: :index
before_action :proposals_recommendations, only: :index, if: :current_user
feature_flag :proposals
@@ -144,4 +145,8 @@ class ProposalsController < ApplicationController
end
end
def proposals_recommendations
@recommended_proposals = Proposal.recommendations(current_user).sort_by_random.limit(3)
end
end