From 578dd9c6e6e61f6f7ef6d589badd04b0ac0b20c9 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 7 May 2023 17:27:34 +0200 Subject: [PATCH] Pass subscribed answer IDs down in Discover views --- app/views/discover/index.html.haml | 2 +- app/views/discover/tab/_answers.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/discover/index.html.haml b/app/views/discover/index.html.haml index c18bdd71..405fb46c 100644 --- a/app/views/discover/index.html.haml +++ b/app/views/discover/index.html.haml @@ -17,7 +17,7 @@ %li.nav-item{ role: "presentation" } %a.nav-link{ href: "#comments", role: :tab, aria: { controls: "comments" }, data: { bs_toggle: :tab } }= t(".content.tab.comments") .tab-content.mt-3 - = render "discover/tab/answers", answers: @popular_answers + = render "discover/tab/answers", answers: @popular_answers, subscribed_answer_ids: @subscribed_answer_ids = render "discover/tab/questions", questions: @popular_questions = render "discover/tab/discussed", comments: @most_discussed .col-md-5.col-sm-6 diff --git a/app/views/discover/tab/_answers.html.haml b/app/views/discover/tab/_answers.html.haml index 68f0bd79..4438edec 100644 --- a/app/views/discover/tab/_answers.html.haml +++ b/app/views/discover/tab/_answers.html.haml @@ -1,3 +1,3 @@ .tab-pane.active.fade.show{ role: :tabpanel, id: "answers" } - answers.each do |a| - = render "answerbox", a: a + = render "answerbox", a:, subscribed_answer_ids: