Polymorphic attachments for Rails 4 and ActiveAdmin

Following my 2012 post!!! I finally managed to write down a small Rails 4 engine that allows anyone to add multiple files to any model in his rails app.

The gem has the highly innovative name of: AttachIt.

As the original post also took into account ActiveAdmin I managed to add the same functionalities to ActiveAdmin also.

The gem is thought for use in the show action for your model.

I have a lot of websites with this requirement of handling multiple files for multiple models so I think this must be a fairly common pattern.

I also use activeadmin quite broadly and find it highly flexible. And it is indeed! Here I use dropzonejs.com inside activeadmin and also import bootstrap modal and grid to handle the responsive image gallery.

Enjoy: https://github.com/tommasop/attach_it