0

我从一开始就完全回滚了我的迁移,所以我可以添加几列,现在当我尝试创建新用户时,我得到一个

NoMethodError in Devise::SessionsController#create

undefined method `image_changed?' for #<User:0x007fa99ea152f8>

我正在使用设计,我有载波。我的应用程序工作正常,我之前有图像,但是当我回滚并从上传文件夹中删除图像时,我得到了这个未定义的方法。

有谁知道这是从哪里来的?我完全一无所知,

谢谢

4

1 回答 1

1

我相信在您的user模型内部,您的模型可能仍安装有载波。

class User < ActiveRecord::Base
  mount_uploader :image, ImageUploader  
  #mounts the uploader to the given column in this case which it is :image
end

错误undefined methodimage_changed?for #` 表示您的模型中必须缺少某种列。

1)rails g migration AddImageToUsers image:string

2) 运行rake db:migrate

于 2013-05-31T04:55:19.203 回答