Sha256: 3bd72049d6c19eb8dfd799f5bd565e81d262ffdcc1ad22ee8e5a278ccdd37e0a

Contents?: true

Size: 706 Bytes

Versions: 12

Compression:

Stored size: 706 Bytes

Contents

require 'rails_admin/config/fields/base'
require 'rails_admin/config/fields/types/file_upload'

module RailsAdmin
  module Config
    module Fields
      module Types
        class Refile < RailsAdmin::Config::Fields::Types::FileUpload
          RailsAdmin::Config::Fields::Types.register(self)

          register_instance_option :thumb_method do
            [:limit, 100, 100]
          end

          register_instance_option :delete_method do
            "remove_#{name}"
          end

          def resource_url(thumb = [])
            return nil unless value
            Object.const_get(:Refile).attachment_url(bindings[:object], name, *thumb)
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_admin-1.4.3 lib/rails_admin/config/fields/types/refile.rb
rails_admin-2.0.0.beta lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.4.2 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.4.1 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.4.0 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.3.0 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.2.0 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.1.1 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.1.0 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.0.0 lib/rails_admin/config/fields/types/refile.rb
rails_admin-1.0.0.rc lib/rails_admin/config/fields/types/refile.rb
rails_admin-0.8.1 lib/rails_admin/config/fields/types/refile.rb