diff --git a/app/controllers/answer_controller.rb b/app/controllers/answer_controller.rb index d5e70881..110486d1 100644 --- a/app/controllers/answer_controller.rb +++ b/app/controllers/answer_controller.rb @@ -9,6 +9,7 @@ class AnswerController < ApplicationController def show @answer = Answer.includes(comments: %i[user smiles], question: [:user], smiles: [:user]).find(params[:id]) + @subscribed = Subscription.where(user: current_user, answer: @answer).pluck(:id) @display_all = true if user_signed_in? diff --git a/app/views/answer/show.html.haml b/app/views/answer/show.html.haml index 5f84d47d..393b0dd5 100644 --- a/app/views/answer/show.html.haml +++ b/app/views/answer/show.html.haml @@ -1,4 +1,4 @@ - provide(:title, answer_title(@answer)) - provide(:og, answer_opengraph(@answer)) .container-lg.container--main - = render 'answerbox', a: @answer, display_all: @display_all + = render 'answerbox', a: @answer, display_all: @display_all, subscribed_answer_ids: @subscribed