Module: RailsAdmin::Config::Fields::Types
- Defined in:
- lib/rails_admin/config/fields/types.rb,
lib/rails_admin/config/fields/types/date.rb,
lib/rails_admin/config/fields/types/enum.rb,
lib/rails_admin/config/fields/types/text.rb,
lib/rails_admin/config/fields/types/time.rb,
lib/rails_admin/config/fields/types/color.rb,
lib/rails_admin/config/fields/types/float.rb,
lib/rails_admin/config/fields/types/string.rb,
lib/rails_admin/config/fields/types/boolean.rb,
lib/rails_admin/config/fields/types/decimal.rb,
lib/rails_admin/config/fields/types/integer.rb,
lib/rails_admin/config/fields/types/datetime.rb,
lib/rails_admin/config/fields/types/password.rb,
lib/rails_admin/config/fields/types/dragonfly.rb,
lib/rails_admin/config/fields/types/paperclip.rb,
lib/rails_admin/config/fields/types/timestamp.rb,
lib/rails_admin/config/fields/types/carrierwave.rb,
lib/rails_admin/config/fields/types/file_upload.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, Carrierwave, Color, Date, Datetime, Decimal, Dragonfly, Enum, FileUpload, Float, HasAndBelongsToManyAssociation, HasManyAssociation, HasOneAssociation, Integer, Paperclip, Password, PolymorphicAssociation, String, Text, Time, Timestamp
Constant Summary
collapse
- @@registry =
{}
Class Method Summary
collapse
Class Method Details
.load(type) ⇒ Object
10
11
12
|
# File 'lib/rails_admin/config/fields/types.rb', line 10
def self.load(type)
@@registry[type.to_sym] or raise "Unsupported field datatype: #{type}"
end
|
.register(type, klass = nil) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/rails_admin/config/fields/types.rb', line 14
def self.register(type, klass = nil)
if klass == nil && type.kind_of?(Class)
klass = type
type = klass.name.to_s.demodulize.underscore
end
@@registry[type.to_sym] = klass
end
|