月別アーカイブ: 2010年10月

rails how to import csv data

1)make csv data

csv data rule

・frist row

set field name to first row

・file name

set  “tablename.csv” as file name

2)put csv files to “test/fixture ”

3)execute rake command

rake db:fixtures:load FIXTURES=tablename