【问题标题】:Ruby on rails : porfile creation with deviseRuby on rails:使用设计创建 porfile
【发布时间】:2016-02-23 14:31:20
【问题描述】:

我对 ruby​​ on rails 完全陌生...我关注了这个讨论 --> Ruby on Rails 4, Devise, and profile pages。我搭建了个人资料,但出现错误click here for image

有什么想法吗??

【问题讨论】:

    标签: ruby-on-rails devise profiles


    【解决方案1】:

    在我看来,您的profiles_table 中没有user_id 属性。再次检查您的迁移。

    【讨论】:

    • 类 CreateProfiles def change
      create_table :profiles do |t|
      t.timestamps null: false
      end
      end
      end -->这是profiles表,我没有user_id,我该怎么办??
    • t.integer :user_id, null: false 添加到您的迁移中,回滚前一个,您应该会很好。顺便说一句,我认为您应该阅读 guides.rubyonrails.org/association_basics.html 您可能还有其他未决问题,但您的关联肯定是错误的。
    猜你喜欢
    • 2016-06-17
    • 1970-01-01
    • 1970-01-01
    • 2016-10-20
    • 2010-09-15
    • 1970-01-01
    • 1970-01-01
    • 2011-01-08
    • 2015-10-06
    相关资源
    最近更新 更多