app/controllers/ingredients_controller.rb
def create
    @ingredient = Ingredient.create(drink_params)

    if @ingredient.save
      render json: @ingredient, status: :created, location: @ingredient
    else
      render json: @ingredient.errors, status: :unprocessable_entity
    end
  end
# POST /ingredients
# POST /ingredients.json
# Only the user can make a Ingredient
POST /ingredients
POST /ingredients.json
Only the user can make a Ingredient
POST / ingredients POST / ingredients . json Only the user can make a Ingredient
def create
    @ingredient = Ingredient.create(drink_params)
    if @ingredient.save
      render json: @ingredient, status: :created, location: @ingredient
    else
      render json: @ingredient.errors, status: :unprocessable_entity
    end
  end
def create @ingredient = Ingredient . create ( drink_params ) if @ingredient . save render json : @ingredient , status : :created , location : @ingredient else render json : @ingredient . errors , status : :unprocessable_entity end end
POST /ingredients
POST /ingredients.json
Only the user can make a Ingredient
POST / ingredients POST / ingredients . json Only the user can make a Ingredient