Undefined method 'dragonfly_accessor'

I am new to dragonfly and trying to get through the settings on the main documentation page for rails. Do not use active recording.

My steps:

1) add to gemfile

gem 'dragonfly', "~>1.0.3"

2) bundle install

3) rails g dragonfly

initializers /dragonfly.rb created

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 by launching mongod and rails s, I get the undefined method error 'dragonfly_accessor'

Any ideas what I am missing?

+3
source share
1 answer

In addition, the users error is that hes does not inherit from ActiveRecord :: Base. The documentation is here. ( https://github.com/markevans/dragonfly )

+1
source

All Articles