Add recommended tab on proposals and debates index.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user