Class: RailsAdmin::Config::Fields::Types::Dragonfly

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

Overview

Field type that supports Paperclip file uploads

Instance Attribute Summary

Attributes inherited from Base

#defined, #name, #order, #properties

Attributes inherited from Base

#abstract_model, #bindings, #parent, #root

Instance Method Summary collapse

Methods inherited from Base

#association?, #column_css_class, #dom_id, #dom_name, #has_errors?, inherited, #initialize, #method_name, #optional, #optional=, #optional?, #type, #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



12
13
14
# File 'lib/rails_admin/config/fields/types/dragonfly.rb', line 12

def errors
  bindings[:object].errors["#{name}_uid"] + bindings[:object].errors["#{name}_name"]
end

#resource_url(thumb = false) ⇒ Object



43
44
45
46
# File 'lib/rails_admin/config/fields/types/dragonfly.rb', line 43

def resource_url(thumb = false)
  return nil unless (v = value)
  thumb ? v.thumb(thumb).try(:url) : v.url
end