I am new to dragonfly and trying to go through the setup directions on the main documentation page for rails. Not using Active Record.
My steps:
1) add to Gemfile
gem 'dragonfly', "~>1.0.3"
2) bundle install
3) rails g dragonfly
created initializers/dragonfly.rb
4) model
class Post
include Mongoid::Document
dragonfly_accessor :image
field :title, type: String
field :body, type: String
end
5) controller
params.require(:post).permit(:title, :body, :image)
Just running mongod and rails s, I get the error of undefined method 'dragonfly_accessor'
Any ideas what I am missing?
Also, the user’s error is that he’s not inheriting from ActiveRecord::Base. Documentation is here. (https://github.com/markevans/dragonfly)
来源:https://stackoverflow.com/questions/21691261/undefined-method-dragonfly-accessor