3

I'm using Refile with a rails 4 app.

I'm getting the error: undefined methodaccepts_attachments_for'`

I'm trying to do multiple image upload, and have two models: books and blobs.

My books.rb:

has_many :blobs, dependent: :destroy
accepts_attachments_for :blobs

My blobs.rb:

belongs_to :book
attachment :file

If I check rake routes, it shows that refile is mounted, so what is the issue?

the_
  • 1,183
  • 2
  • 30
  • 61
  • Could you post the complete error log? – Pavan Jul 01 '15 at 16:44
  • @Pavan, here: `NoMethodError (undefined method accepts_attachments_for for #): app/models/book.rb:6:in app/models/book.rb:1:in app/controllers/books_controller.rb:17:in new` – the_ Jul 01 '15 at 16:51

1 Answers1

6

The feature you're looking to use is discussed here: https://github.com/refile/refile/issues/6 and it doesn't seem to be released yet. If you want to use it, you'll need to use the master branch. You can try using the master branch by changing your Gemfile:

gem 'refile', require: "refile/rails", git: 'https://github.com/refile/refile.git', branch: 'master'
Aldehir
  • 2,025
  • 13
  • 10