Use scope to order headings by name

This commit is contained in:
rgarcia
2018-01-23 19:35:42 +01:00
parent 9e4559e374
commit eee19ad690

View File

@@ -65,7 +65,7 @@
<% @budget.groups.each do |group| %>
<h2><%= group.name %></h2>
<ul class="no-bullet">
<% group.headings.order(name: :asc).each do |heading| %>
<% group.headings.order_by_group_name.each do |heading| %>
<li class="heading small-12 medium-4 large-2">
<%= link_to budget_investments_path(@budget.id, heading_id: heading.id) do %>
<%= heading.name %>