Class: RailsAdmin::Config::Fields::Types::BelongsToAssociation

Inherits:
Association
  • Object
show all
Defined in:
lib/rails_admin/config/fields/types/belongs_to_association.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 Association

#associated_model_config, #associated_model_limit, #associated_object_label_method, #associated_prepopulate_params, #associated_primary_key, #association, #dynamic_scope_relationships, #polymorphic?, #value, #virtual?

Methods inherited from Base

#association?, #eager_load_values, #editable?, #errors, #filter_options, #form_default_value, #form_value, #generic_field_help, #generic_help, #initialize, #inverse_of, #optional, #optional=, #optional?, #parse_input, #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

#method_nameObject



40
41
42
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 40

def method_name
  nested_form ? "#{name}_attributes".to_sym : super
end

#multiple?Boolean

Returns:



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

def multiple?
  false
end

#selected_idObject



36
37
38
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 36

def selected_id
  bindings[:object].safe_send(association.key_accessor)
end