Class: RailsAdmin::Config::Fields::Types::Paperclip

Inherits:
FileUpload show all
Defined in:
lib/rails_admin/config/fields/types/paperclip.rb

Overview

Field type that supports Paperclip file uploads

Instance Attribute Summary

Attributes inherited from Base

#defined, #name, #order, #properties, #section

Attributes inherited from Base

#abstract_model, #bindings, #parent, #root

Instance Method Summary collapse

Methods inherited from Base

#_html_attributes, #association?, #editable, inherited, #initialize, #inverse_of, #method_name, #nested_form, #optional, #optional=, #optional?, #render, #type, #type_css_class, #value, #virtual?

Methods included from Hideable

#hidden?, #hide, included, #show

Methods inherited from Base

#has_option?, #initialize, register_class_option, #register_deprecated_instance_option, register_deprecated_instance_option, #register_instance_option, register_instance_option, #with

Constructor Details

This class inherits a constructor from RailsAdmin::Config::Fields::Base

Instance Method Details

#errorsObject



39
40
41
# File 'lib/rails_admin/config/fields/types/paperclip.rb', line 39

def errors
  bindings[:object].errors["#{name}_file_name"] + bindings[:object].errors["#{name}_content_type"] + bindings[:object].errors["#{name}_file_size"]
end

#resource_url(thumb = false) ⇒ Object



35
36
37
# File 'lib/rails_admin/config/fields/types/paperclip.rb', line 35

def resource_url(thumb = false)
  value.try(:url, (thumb || :original))
end