我有以下seeds.rb文件:幫助Rails種子?
initial_users = User.create(
[
{
:first_name => "Joe",
:last_name => "Smith",
:address1 => "123 Anywhere St.",
:city => "San Francisco",
:state => "CA",
:zip => "12345",
:phone => "123-456-1234",
:password => "password"
},
{
:first_name => "Jane",
:last_name => "Doe",
:address1 => "123 Main St.",
:city => "Los Angeles",
:state => "CA",
:zip => "12345",
:phone => "123-345-4567",
:password => "password"
}
])
但是當我運行耙分貝:種子,該行不會在數據庫中顯示,即使沒有被報告的錯誤?我甚至試過指定RAILS_ENV =開發,但它仍然不顯示。我究竟做錯了什麼?
謝謝......我有一些吃剩的驗證:)我會檢查出來的燈具進行更換。有沒有一個地方可以幫助您瞭解除了谷歌之外的隨機數據生成? – Kevin
http://ruby-toolbox.com有生活中所有案例的圖書館 – Eimantas