Nutrients is a project mainly written in Ruby, based on the MIT license.
Rails 3 plugin providing a database and models for querying nutrition information about food items
This is a Rails 3 plugin providing a database and models for querying nutrition information about food items.
Database source: USDA National Nutrient Database for Standard Reference, Release 22 http://www.ars.usda.gov/Services/docs.htm?docid=8964
To set up SQLite database:
To set up MySQL database:
Food.search('apple').first.nutrients.each do |nutrient_data| puts "#{nutrient_data.nutrient.name}: #{nutrient_data.value_per_100g} #{nutrient_data.nutrient.units}" end
Copyright (c) 2010 Levente Bagi, released under the MIT license