back to

Ruby on Rails To-do List

ARCHIVED

Archived: This project has been archived. Cards can no longer be completed.

Deleting Todo Items

Stefy
Stefy completed this card.
def destroy
  	@todo_item = @todo_list.todo_items.find(params[:id])
  	if @todo_item.destroy
  		flash[:success] = "Todo list item was deleted."
  	else
  		flash[:error] = "Todo list item could not be deleted."
    end 
    redirect_to todo_list_todo_items_path
  end