开发者

What is the best way of add sample data in rails application, fixtures or migration?

开发者 https://www.devze.com 2023-03-07 01:40 出处:网络
I want to add a sample data to application using migration or fixtures , which is better? For example I have user model an开发者_如何学Cd want to add some sample user (foo,baar,baz)Neither, use the db

I want to add a sample data to application using migration or fixtures , which is better? For example I have user model an开发者_如何学Cd want to add some sample user (foo,baar,baz)


Neither, use the db/seeds.rb file. Railscasts episode 179 covers this nicely.

0

精彩评论

暂无评论...
验证码 换一张
取 消