カテゴリー別アーカイブ: rails

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