2010-03-04 44 views

回答

0

尝试类似:

associated_category = Category.find_by_name(row['Category']) 
Produkt.create(
     :category_id => associated_category.id, 
     :name => row[2] 
     ) 

我这样做的:http://gist.github.com/324613

危害