mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 16:29:52 +01:00
Check subscription in answer/show
This commit is contained in:
parent
7aed99d187
commit
d7997db492
2 changed files with 2 additions and 1 deletions
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue