Add recommended tab on proposals and debates index.

This commit is contained in:
taitus
2017-07-28 13:43:01 +02:00
parent 01a41b4706
commit fe3bb7a389
15 changed files with 92 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
class WelcomeController < ApplicationController
skip_authorization_check
before_action :set_user_recommendations, only: :index, if: :current_user
layout "devise", only: [:welcome, :verification]
@@ -13,4 +14,11 @@ class WelcomeController < ApplicationController
redirect_to verification_path if signed_in?
end
private
def set_user_recommendations
@recommended_debates = Debate.recommended(current_user).limit(3)
@recommended_proposals = Proposal.recommended(current_user).limit(3)
end
end