Adds recommendations on proposals index
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user