3

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?

Kara
  • 6,115
  • 16
  • 50
  • 57

1 Answers1

0

Also, the user’s error is that he’s not inheriting from ActiveRecord::Base. Documentation is here. (https://github.com/markevans/dragonfly)

Lauren
  • 2,557
  • 1
  • 14
  • 16