diff --git a/app/helpers/products_helper.rb b/app/helpers/products_helper.rb new file mode 100644 index 0000000..87d5bd7 --- /dev/null +++ b/app/helpers/products_helper.rb @@ -0,0 +1,13 @@ +module ProductsHelper + def kcal(calories) + calories.to_s + " kcal" + end + + def kcal_tag(calories) + if calories + content_tag :small, kcal(calories) + else + ' '.html_safe + end + end +end