I am using rails_admin and paperclip but installing rails_admin with a model having paperclip attributes has_attached_file
throws an error
undefined method `attachment_definitions'
I am using Rails 4 and rails_admin at master git branch and protected attributes gem.
I am on rails 3 still but ran into the same issue. I am fairly certain its an issue with the latest paperclip and rails_admin. I backed paperclip down to paperclip (3.4.2) and everything works.
Another thing of note I am using ruby 1.9.3
So for the newer rails guys/galls
In your gem file
gem "paperclip", "3.4.2"
then bundle update
not sure if other versions will work but I know that one does
Are you properly calling has_attached_file in the model itself?
I had ruby (1.9.3), Rails (4.0.1), paperclip (3.5.2) and rails_admin (0.5.0) working without error. Then I created a new model. It had all the usual paperclip columns and should have worked. But I got that same error message.
My problem (duh) was that I neglected to configure paperclip in the model itself, but had the paperclip columns in my schema. I wasn't calling has_attached_file ... in my model.
has_attached_file :img...
I loosely recall that rails_admin sniffs certain paperclip smelling columns and acts on it. So I had the paperclip like columns, which rails_admin detected, but never called has_attaached_file resulting in the error. And that error makes sense, there were indeed no "attachment_definitions" to speak of!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With