Class: RailsAdmin::Config::Fields::Types::Boolean

Inherits:
Base
  • Object
show all
Defined in:
lib/rails_admin/config/fields/types/boolean.rb

Constant Summary

Constants inherited from Base

Base::NAMED_INSTANCE_VARIABLES

Instance Attribute Summary

Attributes inherited from Base

#abstract_model, #defined, #name, #order, #parent, #properties, #root, #section

Instance Method Summary collapse

Methods inherited from Base

#association?, #eager_load_values, #editable?, #errors, #filter_options, #form_default_value, #generic_field_help, #initialize, #inverse_of, #method_name, #optional, #optional=, #optional?, #parse_value, #sort_column, #type, #type_css_class, #value, #virtual?

Methods included from Inspectable

#inspect

Methods included from Groupable

#group

Methods included from Hideable

#hidden?, #hide, included, #show

Methods included from Configurable

#has_option?, #register_deprecated_instance_option, #register_instance_option

Methods included from Proxyable

#bindings, #bindings=, #with

Constructor Details

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

Instance Method Details

#form_valueObject



51
52
53
54
55
56
# File 'lib/rails_admin/config/fields/types/boolean.rb', line 51

def form_value
  case value
  when true, false
    value
  end
end

#generic_helpObject

Accessor for field's help text displayed below input field.



59
60
61
# File 'lib/rails_admin/config/fields/types/boolean.rb', line 59

def generic_help
  ''
end

#parse_input(params) ⇒ Object



63
64
65
# File 'lib/rails_admin/config/fields/types/boolean.rb', line 63

def parse_input(params)
  params[name] = params[name].presence if params.key?(name)
end