app/models/burger.rb
#Call Openfoodfacts API for product's nutriment
Call Openfoodfacts API for product's nutriment
Call Openfoodfacts API for product ' s nutriment
def nutriments
        product = Openfoodfacts::Product.get(self.code, locale: 'fr')
        if product
            return product.nutriments.to_hash
        else
            return ["nutriment" => "Could not retrieve nutriments, product code must be erroned"]
        end
    end
def nutriments product = Openfoodfacts :: Product . get ( self . code , locale : 'fr' ) if product return product . nutriments . to_hash else return [ "nutriment" => "Could not retrieve nutriments, product code must be erroned" ] end end
Call Openfoodfacts API for product's nutriment
Call Openfoodfacts API for product ' s nutriment