diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 17926429..58060d22 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -7,6 +7,7 @@ class UserController < ApplicationController def show @answers = @user.cursored_answers(last_id: params[:last_id]) + @pinned_answers = @user.answers.pinned.limit(10) @answers_last_id = @answers.map(&:id).min @more_data_available = !@user.cursored_answers(last_id: @answers_last_id, size: 1).count.zero? diff --git a/app/views/user/show.html.haml b/app/views/user/show.html.haml index 4456aa90..25240a33 100644 --- a/app/views/user/show.html.haml +++ b/app/views/user/show.html.haml @@ -1,6 +1,6 @@ - unless @user.banned? #pinned-answers - - @user.answers.pinned.each do |a| + - @pinned_answers.each do |a| = render "answerbox", a: #answers