4
我試圖用色器件恢復用戶的密碼,但它會生成以下錯誤如何恢復密碼與設計(Ruby on Rails的)
undefined method `reset_password_sent_at=' for #<User:0x007fb78cfafb68>
誰能幫助我,因爲我m新的Ruby on Rails?
什麼是恢復密碼和使用Devise給用戶發送電子郵件的最佳方式?非常感謝您......
我用色器件(2.2.3)
User.rb
require 'digest/md5'
class User < ActiveRecord::Base
# Setup accessible (or protected) attributes for your model
belongs_to :shop
before_create :compute_email_md5
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable,
:rememberable,
:trackable,
:validatable,
:token_authenticatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email,
:email_md5,
:password,
:password_confirmation,
:shop_id,
:role,
:terms,
:name,
:notify_on_order_received
validates :terms, :acceptance => true, :on => :create
end
的解決方案是 reset_password_sent_at列到用戶表
版本的設計?你能顯示一些代碼嗎? – Nobita 2013-02-19 16:29:49
好的我'使用設計2.2.3 – 2013-02-19 16:36:42
請顯示你正在使用設計的模型。 – Nobita 2013-02-19 16:41:05