Skip to content

Instantly share code, notes, and snippets.

@pier-oliviert
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save pier-oliviert/1d8baa0787ecdae63b94 to your computer and use it in GitHub Desktop.

Select an option

Save pier-oliviert/1d8baa0787ecdae63b94 to your computer and use it in GitHub Desktop.
link_to meal_ingredients_path(meal) do |link|
if meal.ingredients.need > 0
"Liste d'épicerie — il vous manque #{meal.ingredients.need} ingrédients"
else
link[:class] << 'complete'
"Vous avez tous les ingrédients!"
end
end
<a href="/meals/29/ingredients" class="complete">Vous avez tous les ingrédients!</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment