1
0

New objects are now created through association

Added Sources to sidebar
This commit is contained in:
cryptogopher
2019-09-23 15:35:43 +02:00
parent ce9f011694
commit c96cea5ca6
10 changed files with 21 additions and 10 deletions

View File

@@ -3,7 +3,7 @@
<div class="box tabular">
<p><%= f.text_field :name, size: 40, required: true %></p>
<p>
<%= f.number_field :ref_amount, size: 8, required: true, min: 0 %>
<%= f.number_field :ref_amount, size: 8, required: true, min: 0, label: :field_reference %>
<%= f.select :ref_unit_id, unit_options, {label: '', required: true} %>
</p>
<p><%= f.select :group, group_options, required: true %></p>

View File

@@ -46,7 +46,7 @@
</div>
<h2><%= t ".heading" %></h2>
<% if @ingredients.any? %>
<% if @ingredients.many? %>
<table class="list">
<thead>
<tr>
@@ -59,6 +59,7 @@
</thead>
<tbody>
<% @ingredients.each do |i| %>
<% next if i.new_record? %>
<tr id="ingredient-<%= i.id %>" class="ingredient <%= 'hidden' if i.hidden %>">
<td class="name"><%= i.name %></td>
<td class="reference"><%= i.ref_amount %> [<%= i.ref_unit.shortname %>]</td>