diff --git a/app/controllers/ingredients_controller.rb b/app/controllers/ingredients_controller.rb index cc980b2..642b39b 100644 --- a/app/controllers/ingredients_controller.rb +++ b/app/controllers/ingredients_controller.rb @@ -88,6 +88,7 @@ class IngredientsController < ApplicationController i_params = { name: r.delete('Name'), + comment: r.delete('Comment'), ref_amount: 100.0, ref_unit: units['g'], group: r.delete('Group') || :other, @@ -176,6 +177,7 @@ class IngredientsController < ApplicationController def ingredient_params params.require(:ingredient).permit( :name, + :comment, :ref_amount, :ref_unit_id, :group, diff --git a/app/views/ingredients/_form.html.erb b/app/views/ingredients/_form.html.erb index 8ebdfec..c0d766d 100644 --- a/app/views/ingredients/_form.html.erb +++ b/app/views/ingredients/_form.html.erb @@ -9,6 +9,8 @@
<%= f.text_field :name, size: 40, required: true %>
+<%= f.text_area :comment, cols: 40, rows: 3, required: false, + style: "width: 100%;" %>
<%= f.number_field :ref_amount, size: 8, required: true, min: 0, label: :field_reference %> diff --git a/app/views/ingredients/_list.html.erb b/app/views/ingredients/_list.html.erb index a79b070..8568a62 100644 --- a/app/views/ingredients/_list.html.erb +++ b/app/views/ingredients/_list.html.erb @@ -5,18 +5,19 @@
<%= l(:field_name) %> | +<%= l(:field_name) %> | +<%= l(:field_comment) %> | <%= l(:field_reference) %> | <%= l(:field_group) %> | <%= l(:field_source) %> | -<%= l(:field_action) %> | +<%= l(:field_action) %> |
---|---|---|---|---|---|---|---|
+ | <%= link_to '', toggle_ingredient_path(i), { remote: true, method: :post, @@ -24,13 +25,14 @@ } %> <%= i.name %> | +<%= i.comment %> | <%= i.ref_amount %> [<%= i.ref_unit.shortname %>] | <%= i.group %> | <%= i.source.name if i.source.present? %> <%= ", #{i.source_ident}" if i.source_ident.present? %> | -+ | <%= delete_link ingredient_path(i), {remote: true, data: {}} %> |
+ | <%= i.name %> | <% values.each do |*, value| %> diff --git a/app/views/measurements/_index.html.erb b/app/views/measurements/_index.html.erb index dc4d5bc..375160c 100644 --- a/app/views/measurements/_index.html.erb +++ b/app/views/measurements/_index.html.erb @@ -8,7 +8,7 @@<%= l(:field_taken_at_date) %> | <%= l(:field_name) %> | <%= l(:field_source) %> | -<%= l(:field_action) %> | +<%= l(:field_action) %> | <%= l(:field_domain) %> | <%= l(:field_description) %> | <%= l(:field_formula) %> | -<%= l(:field_action) %> | +<%= l(:field_action) %> | diff --git a/app/views/sources/index.html.erb b/app/views/sources/index.html.erb index 261e500..60c5609 100644 --- a/app/views/sources/index.html.erb +++ b/app/views/sources/index.html.erb @@ -30,7 +30,7 @@
<%= l(:field_name) %> | <%= l(:field_description) %> | -<%= l(:field_action) %> | +<%= l(:field_action) %> | ||||
<%= l(:field_shortname) %> | <%= l(:field_name) %> | -<%= l(:field_action) %> | +<%= l(:field_action) %> |