【问题标题】:Ran rake db:seed command without a error; not updating in browser运行 rake db:seed 命令没有错误;浏览器不更新
【发布时间】:2014-05-07 07:51:41
【问题描述】:

我没有错误地为数据库播种(sudo rake db:seed)。但是当我运行服务器(“localhost:3000/merchants”)时,没有显示任何种子信息。感谢您的帮助。

到 git 存储库的链接:https://github.com/b s h p orkin/Other-Stuff

【问题讨论】:

  • 你的github链接坏了

标签: ruby-on-rails localhost seeding


【解决方案1】:

你需要使用

create!

而不是创建。 例如

MerchantCategory.create!([{name: Faker::Commerce.department}])

【讨论】:

    猜你喜欢
    • 2011-02-08
    • 2017-01-03
    • 2019-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多