小编bur*_*ren的帖子

carrierwave - rails 3.1- undefined method:image_will_change

我收到一个看起来像这样的错误:

undefined method `post_image_will_change!' for #<Post:0xf4e9184>
app/controllers/posts_controller.rb:43:in `new'
app/controllers/posts_controller.rb:43:in `create'
Run Code Online (Sandbox Code Playgroud)

我把它包含在我的"帖子"模型中:

 attr_accessible :title, :name, :content, :post_image
 mount_uploader :post_image, PostImageUploader
Run Code Online (Sandbox Code Playgroud)

并在_form.html.erb我添加了:

 :html =>  { :multipart => true }
Run Code Online (Sandbox Code Playgroud)

我看了CarrierWave Error,但这对我没有帮助.

什么产生错误的线索?我已经迁移了数据库等等(紧跟载波的railscasts指南......)

railscasts carrierwave ruby-on-rails-3.1

32
推荐指数
3
解决办法
2万
查看次数