Reputation: 83
I am using the following commond
gem 'carrierwave'
bundle
rails generate uploader image
mount_uploader :image, ImageUploader
but it gives the errors
NoMethodError in PostsController#index
undefined method `mount_uploader' for Post:Class Extracted source (around line #8):
line #8: mount_uploader :image, ImageUploader
end
Upvotes: 0
Views: 240
Reputation: 743
I think your problem is you are using the wrong gem, for mongodb using mongoid ORM you should use the following gem,
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
If you install this you problem should get solved.
Upvotes: 0