我想知道如何将设计添加到不同用户的现有数据库。在这里,我已经有了一个客户模型定义,并且我想更改以允许设计工作。从现有的模型/数据库设计安装
我创建了一个新的迁移和插入的代码具有遵循
class AddDeviseToCustomer < ActiveRecord::Migration
def change
change_table :customers do |t|
#t.database_authenticatable
t.string :encrypted_password, :null => false, :default => '', :limit => 128
t.confirmable
t.recoverable
t.rememberable
t.trackable
t.token_authenticatable
t.timestamps
end
end
end
根据这个它应该工作。 https://github.com/plataformatec/devise/wiki/How-To:-change-an-already-existing-table-to-add-devise-required-columns。但运行耙分贝时:迁移我得到以下
undefined method `confirmable' for #<ActiveRecord::ConnectionAdapters::Table:0x9286a28>
我已经运行下面一行
rails g devise:install
任何理由色器件将无法识别它,做我需要做的话要说客户一个设计? 在此先感谢
您是否将“设计”gem添加到您的Gemfile中,然后运行“捆绑安装”?只是一个确认:) – 2012-08-14 14:25:12
是的,我做了,但我看到没有帮手参与。我应该担心这些吗? – Jseb 2012-08-14 14:26:08
马克正确答案! – retro 2012-08-14 16:18:10