Rails + CarrierWave: NoMethodError: undefined method `name' for nil:NilClass

后端 未结 6 528
挽巷
挽巷 2021-01-18 02:19

I am using CarrierWave with Rails 3.1. I am getting the following error message when I submit the form (trying to upload an image):

Error Message:

Ac         


        
6条回答
  •  囚心锁ツ
    2021-01-18 02:37

    I came across this post because I had the same error you described, but restarting the server didn't resolve it (as suggested by other answers). In my case, the problem was caused because I used mount_uploader before attr_accessible. By switching them I solved the problem.

提交回复
热议问题