Sha256: 3ac355daaa4dc435fb6e6b5fcadeeacb885cf51b9352b803734bbb24563a82f3

Contents?: true

Size: 592 Bytes

Versions: 6

Compression:

Stored size: 592 Bytes

Contents

module ActiveAdmin::ViewsHelper

  def render_mock_dropzone_files(dropzone_objects)
    dropzone_objects.map do |dropzone_object|
      { 
        id: dropzone_object.id, 
        name: dropzone_object.send(dropzone_object.class.dropzone_field(:title)),
        size: dropzone_object.send(dropzone_object.class.dropzone_field(:file_size)), 
        url: dropzone_object.send(dropzone_object.class.dropzone_field(:url))
      }
    end.map do |hash|
      hash.map{ |(k, v)| "#{ k }: '#{ v }'" }.join(',')
    end.map do |string|
      "{#{ string }}"
    end.join(', ').html_safe
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activeadmin-dropzone-0.2.4 app/helpers/active_admin/views_helper.rb
activeadmin-dropzone-0.2.3 app/helpers/active_admin/views_helper.rb
activeadmin-dropzone-0.2.2 app/helpers/active_admin/views_helper.rb
activeadmin-dropzone-0.2.1 app/helpers/active_admin/views_helper.rb
activeadmin-dropzone-0.0.2 app/helpers/active_admin/views_helper.rb
activeadmin-dropzone-0.0.1 app/helpers/active_admin/views_helper.rb