Module: RailsAdmin::Config::Fields::Types

Defined in:
lib/rails_admin/config/fields/types.rb,
lib/rails_admin/config/fields/types/enum.rb,
lib/rails_admin/config/fields/types/json.rb,
lib/rails_admin/config/fields/types/text.rb,
lib/rails_admin/config/fields/types/inet.rb,
lib/rails_admin/config/fields/types/date.rb,
lib/rails_admin/config/fields/types/time.rb,
lib/rails_admin/config/fields/types/float.rb,
lib/rails_admin/config/fields/types/color.rb,
lib/rails_admin/config/fields/types/hidden.rb,
lib/rails_admin/config/fields/types/string.rb,
lib/rails_admin/config/fields/types/integer.rb,
lib/rails_admin/config/fields/types/boolean.rb,
lib/rails_admin/config/fields/types/decimal.rb,
lib/rails_admin/config/fields/types/password.rb,
lib/rails_admin/config/fields/types/datetime.rb,
lib/rails_admin/config/fields/types/dragonfly.rb,
lib/rails_admin/config/fields/types/timestamp.rb,
lib/rails_admin/config/fields/types/wysihtml5.rb,
lib/rails_admin/config/fields/types/paperclip.rb,
lib/rails_admin/config/fields/types/ck_editor.rb,
lib/rails_admin/config/fields/types/serialized.rb,
lib/rails_admin/config/fields/types/carrierwave.rb,
lib/rails_admin/config/fields/types/code_mirror.rb,
lib/rails_admin/config/fields/types/file_upload.rb,
lib/rails_admin/config/fields/types/bson_object_id.rb,
lib/rails_admin/config/fields/types/has_one_association.rb,
lib/rails_admin/config/fields/types/has_many_association.rb,
lib/rails_admin/config/fields/types/belongs_to_association.rb,
lib/rails_admin/config/fields/types/polymorphic_association.rb,
lib/rails_admin/config/fields/types/has_and_belongs_to_many_association.rb

Defined Under Namespace

Classes: BelongsToAssociation, Boolean, BsonObjectId, CKEditor, Carrierwave, CodeMirror, Color, Date, Datetime, Decimal, Dragonfly, Enum, FileUpload, Float, HasAndBelongsToManyAssociation, HasManyAssociation, HasOneAssociation, Hidden, Inet, Integer, Json, Paperclip, Password, PolymorphicAssociation, Serialized, String, Text, Time, Timestamp, Wysihtml5

Constant Summary

@@registry =
{}

Class Method Summary collapse

Class Method Details

.load(type) ⇒ Object



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

def self.load(type)
  @@registry[type.to_sym] || fail("Unsupported field datatype: #{type}")
end

.register(type, klass = nil) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/rails_admin/config/fields/types.rb', line 15

def self.register(type, klass = nil)
  if klass.nil? && type.is_a?(Class)
    klass = type
    type = klass.name.to_s.demodulize.underscore
  end
  @@registry[type.to_sym] = klass
end