No release in over 3 years
There's a lot of open issues
Easy to use integration of drag&drop files upload via dropzone.js for RailsAdmin
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2
>= 6.0, < 7
~> 13.0
~> 3.10

Runtime

>= 4.0, < 5
>= 1.11.0.rc4
 Project Readme

Custom Action to RailsAdmin with Dropzone.js Multiple File Upload

Gem Version

Easy to use integration of drag&drop files upload via dropzone.js for rails_admin

Screenshot

Dropzone

Imgur

Upload images

Imgur

How to use

Add in Gemfile

gem 'rails_admin_dropzone'

IMPORTANT:

For versions of rails below 5, use version V1.0.1 Tested with Rails 6

class Album < ActiveRecord::Base
  has_many :photos
end

class Photo < ActiveRecord::Base
  belongs_to :album
end

Add this method create_associated_image in your model, example Album, that will contain the upload images and change the associations and attributes

class Album < ActiveRecord::Base
  has_many :photos

  # Method
  def create_associated_image(image)
    photos.create(image: image)
  end
end

Add in config/initialisers/rails_admin.rb

RailsAdmin.config do |config|
  config.actions do
    dashboard
    index
    new

    dropzone do
      only YOUR_MODEL # Example Album
    end

    show
    edit
    delete
  end
end

and "Voalá"

TODO

  • Adjustments to work with Turbolinks 5
  • Add Tests

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/luizpicolo/rails_admin_dropzone. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.