app/models/list.rb
# Create list_item in current_user's list, dish model to increases dish popularity
Create list_item in current_user's list, dish model to increases dish popularity
Create list_item in current_user ' s list dish model to increases dish popularity
def add_item(dish_id)
    self.list_items.create(dish_id: dish_id)
    @dish = Dish.find_by(id: dish_id)
    @dish.increase_popularity
  end
def add_item ( dish_id ) self . list_items . create ( dish_id : dish_id ) @dish = Dish . find_by ( id : dish_id ) @dish . increase_popularity end
Create list_item in current_user's list, dish model to increases dish popularity
Create list_item in current_user ' s list dish model to increases dish popularity
dish_id
<not_specific>