Adds basic Budget controller / views

This commit is contained in:
kikito
2016-05-31 19:26:56 +02:00
parent 0427395f32
commit fa6f34bf5c
9 changed files with 72 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
<h1>Budget Index</h1>
<ul>
<% @budgets.each do |budget| %>
<li><%= link_to budget.name, budget %></li>
<% end %>
</ul>

View File

@@ -0,0 +1,15 @@
<h1><%= @budget.name %></h1>
<div><%= @budget.description %></div>
<ul>
<li><%= link_to budget_investments_path(budget_id: @budget.id, heading_id: nil) do %>
No heading (<%= format_price(@budget, @budget.price) %>)
<% end %></li>
<% @budget.headings.each do |heading| %>
<li><%= link_to budget_investments_path(budget_id: @budget.id, heading_id: heading.id) do %>
<%= heading.name %> (<%= format_price(@budget, heading.price) %>)
<% end %>
</li>
<% end %>
</ul>