From 4916f9a3c313da2d420dfe21276520dbd7e8aa3f Mon Sep 17 00:00:00 2001 From: Bertocq Date: Mon, 8 Jan 2018 23:02:18 +0100 Subject: [PATCH] Avoid listing non-published Budgets to the public Why: Non-admins shouldn't be aware of non-published Budgets How: Using the budget_published? helper method --- app/views/budgets/index.html.erb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 8cde29bc7..0ccc8bcef 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -16,14 +16,16 @@ <% @budgets.each do |budget| %> - - - <%= link_to budget.name, budget %> - - - <%= budget.translated_phase %> - - + <% if budget_published?(budget) %> + + + <%= link_to budget.name, budget %> + + + <%= budget.translated_phase %> + + + <% end %> <% end %>