Recommendations are automatically disabled if dismissed by user

This commit is contained in:
Angel Perez
2018-07-11 21:45:28 -04:00
parent 0b7967440f
commit 463c753880
12 changed files with 74 additions and 19 deletions

View File

@@ -80,6 +80,14 @@ class ProposalsController < ApplicationController
@tag_cloud = tag_cloud
end
def disable_recommendations
if current_user.update(recommended_proposals: false)
redirect_to proposals_path, notice: t('proposals.index.recommendations.actions.success')
else
redirect_to proposals_path, error: t('proposals.index.recommendations.actions.error')
end
end
private
def proposal_params