No commit activity in last 3 years
No release in over 3 years
Rails admin multiple file upload with AJAX and DnD
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

>= 5.0
>= 1.0.0.rc
 Project Readme

RailsAdminMultipleFileUpload

rails_admin + dropzone.js + mongoid(embedded)

Installation

Add this line to your application's Gemfile:

gem 'rails_admin_multiple_file_upload', '~> 0.4.3'

And then execute:

$ bundle

Usage with rails_admin

Add the sort_embedded action for each model or only for models you need

    RailsAdmin.config do |config|
      config.actions do
        ......
        multiple_file_upload do
          visible do
            %w(Page).include? bindings[:abstract_model].model_name
          end
        end
      end
    end

In embedded model:

    has_mongoid_attached_file :image, styles: {main: "1000x1000>"}

In rails_admin block for parent model:

    multiple_file_upload(
        {
            fields: [:my_news_images],
            thumbnail_size: :main #default :thumb
        }
    )

In config/locales/* :

I18n:

    ru:
      rails_admin:
        multiple_file_upload:
          my_news:
            my_news_images: Фотогалерея

    # or with specified fields
    ru:
      rails_admin:
        multiple_file_upload:
          my_news:
            my_news_images:
              image: Фотогалерея
              image2: Фотогалерея вторая

Copy and paste support

After clicking on grey area around dropzone block You can use clipboard. You can paste screenshots (or any images if clipboard) and URL. System add it to dropzone as image (if it`s a really image)

TODO

  • Documentation fixes
  • Carrierwave support
  • More configs
  • Style
  • Find and fix bugs. I am sure, bugs are here

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

Some ideas and code for this gem are taken from: