1
0

Updated Ingredients to use ItemsWithQuantities

This commit is contained in:
cryptogopher
2019-12-29 15:12:05 +01:00
parent 61bd34fdc5
commit 20deb944c3
19 changed files with 125 additions and 226 deletions

View File

@@ -1,2 +1,6 @@
module BodyTrackersHelper
def format_value(value)
amount, unitname = value
amount.nil? ? '-' : "#{amount} [#{unitname || '-'}]"
end
end

View File

@@ -38,4 +38,8 @@ module IngredientsHelper
[translations[k.to_sym], k]
end
end
def action_links(i)
delete_link(ingredient_path(i), {remote: true, data: {}})
end
end

View File

@@ -9,11 +9,6 @@ module MeasurementsHelper
m.taken_at.getlocal.strftime("%R")
end
def format_value(value)
amount, unitname = value
amount.nil? ? '-' : "#{amount} [#{unitname || '-'}]"
end
def toggle_column_options
disabled = []
enabled_columns = @scoping_measurement.column_view.quantities