我刚刚执行了这个:
rails g scaffold Photos name:string description:string
并在该模型中添加了回形针:
rails g paperclip Photo image
当我去的时候,photos/new
我得到了这个:
undefined method `model_name' for NilClass:Class
它可能是什么问题?@photo = Photo.new
在控制器中有,form_for(@photo)
在 new.html.erb 中有
谢谢你的帮助!