1
0

Toggling quantity primariness from nutrients view

This commit is contained in:
cryptogopher
2019-11-01 21:43:56 +01:00
parent 09c441f662
commit cf9c913897
12 changed files with 174 additions and 102 deletions

View File

@@ -5,6 +5,15 @@ module IngredientsHelper
end
end
def nutrient_column_options
disabled = []
options = nested_set_options(@project.quantities.diet) do |q|
disabled << q.id if q.primary
raw("#{'&ensp;' * q.level}#{q.name}")
end
options_for_select(options, disabled: disabled)
end
def unit_options
@project.units.map do |u|
[u.shortname, u.id]