From c56a7b4e1663ec8675b3ed74a67a0798636d0156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Thu, 11 Jan 2018 16:49:07 +0100 Subject: [PATCH] Added related contents to budget investments --- app/controllers/budgets/investments_controller.rb | 1 + app/views/budgets/investments/_investment_show.html.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/budgets/investments_controller.rb b/app/controllers/budgets/investments_controller.rb index 8522352e3..2913ea260 100644 --- a/app/controllers/budgets/investments_controller.rb +++ b/app/controllers/budgets/investments_controller.rb @@ -41,6 +41,7 @@ module Budgets def show @commentable = @investment @comment_tree = CommentTree.new(@commentable, params[:page], @current_order) + @related_contents = Kaminari.paginate_array(@investment.relationed_contents).page(params[:page]).per(5) set_comment_flags(@comment_tree.comments) load_investment_votes(@investment) @investment_ids = [@investment.id] diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index 3b0078bf8..a41f360c7 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -76,6 +76,7 @@

<%= investment.price_explanation %>

<% end %> + <%= render 'relationable/related_content', relationable: @investment %>