adds different back link if headings count equal to 1

This commit is contained in:
Alberto Garcia Cabeza
2017-01-17 18:16:50 +01:00
parent 6c227547e2
commit 2aaf917510

View File

@@ -4,8 +4,13 @@
<div class="row">
<div class="small-12 column">
<%= back_link_to budget_group_path(@budget, @heading.group, unfeasible: params[:unfeasible]) %>
<% if @heading.group.headings.count == 1 %>
<%= back_link_to budget_path(@budget, unfeasible: params[:unfeasible]) %>
<% else %>
<%= back_link_to budget_group_path(@budget,
@heading.group,
unfeasible: params[:unfeasible]) %>
<% end %>
<% if can? :show, @ballot %>
<%= link_to t("budgets.investments.header.check_ballot"),
budget_ballot_path(@budget),