Sha256: 1d6f6327be0f3821829ad40437117441787ed1d35ed5b7e61191d1fde747383b

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

module ActiveAdmin::ViewHelpers::DropzoneHelper

  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

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-dropzone-0.2.6 app/helpers/active_admin/view_helpers/dropzone_helper.rb