json.extract! @ingredient, :id, :name, :ndbn, :usda_food_name, :notes, :density, :water, :ash, :protein, :kcal, :fiber, :sugar, :carbohydrates, :calcium, :iron, :magnesium, :phosphorus, :potassium, :sodium, :zinc, :copper, :manganese, :vit_c, :vit_b6, :vit_b12, :vit_a, :vit_e, :vit_d, :vit_k, :cholesterol, :lipids if @ingredient.ndbn.present? json.ndbn_units @ingredient.usda_food.usda_food_weights do |fw| json.extract! fw, :amount, :description, :gram_weight end else json.ndbn_units [] end json.ingredient_units @ingredient.ingredient_units do |iu| json.extract! iu, :id, :name, :gram_weight json._destroy false end