1
0

Buttons/amount in separate columns

This commit is contained in:
cryptogopher
2020-04-20 22:07:10 +02:00
parent baaefb2b68
commit 6b5cb85b11
2 changed files with 17 additions and 19 deletions

View File

@@ -5,17 +5,6 @@ module MealsHelper
delete_link(meal_path(m), {remote: true, data: {}})
end
def adjust_ingredient_links(i)
{'- -' => -10, '-' => -1, nil => 0, '+' => 1, '++' => 10}.map do |text, value|
if text
link_to text, adjust_ingredient_path(i, adjustment: value),
{remote: true, method: :post, class: "button #{value>0 ? 'green' : 'red'}"}
else
yield.to_s
end
end.reduce(:+)
end
def display_notes(m)
content_tag(:span, m.notes) +
link_to(l(:button_notes), edit_notes_meal_path(m),