我试图在多步向导上设置验证(使用 wicked gem 和这个GUIDE)。第一步我正在输入一些用户信息(使用设计 + 注册),但是当我提交时,我收到以下错误:
NoMethodError in RegistrationsController#create
undefined method `include?' for nil:NilClass
Rails.root: /Users/nelsonkeating/Desktop/remindeal1
Application Trace | Framework Trace | Full Trace
app/models/user.rb:54:in `active_or_address?'
Class User
validates_presence_of :address, :presence => true, :if => :active_or_address?
def active_or_address?
status.include?('address') || active?
end
def active?
status == 'active'
end