diff --git a/app/controllers/ingredients_controller.rb b/app/controllers/ingredients_controller.rb index 6c43825..561eeeb 100644 --- a/app/controllers/ingredients_controller.rb +++ b/app/controllers/ingredients_controller.rb @@ -41,12 +41,12 @@ class IngredientsController < ApplicationController end def destroy - # FIXME: redirect to :back? # FIXME: don't destroy if any meal depend on ingredient if @ingredient.destroy flash[:notice] = 'Deleted ingredient' end - redirect_to project_ingredients_url(@project) + prepare_ingredients + render :toggle end def toggle diff --git a/app/views/ingredients/_list.html.erb b/app/views/ingredients/_list.html.erb index 10c652e..350ead2 100644 --- a/app/views/ingredients/_list.html.erb +++ b/app/views/ingredients/_list.html.erb @@ -27,7 +27,9 @@ <%= i.source.name if i.source.present? %> <%= ", #{i.source_ident}" if i.source_ident.present? %> -