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

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

Direct Known Subclasses

PolymorphicAssociation

Instance Attribute Summary

Attributes inherited from Base

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

Attributes included from Proxyable

#bindings

Instance Method Summary collapse

Methods inherited from Association

#associated_model_config, #associated_object_label_method, #associated_primary_key, #association, #foreign_key, inherited, #inverse_of, #polymorphic?, #value, #virtual?

Methods inherited from Base

#association?, #editable?, #errors, #html_default_value, #initialize, #inverse_of, #optional, #optional=, #optional?, #type, #type_css_class, #value, #virtual?

Methods included from Groupable

#group

Methods included from Hideable

#hidden?, #hide, included, #show

Methods included from Configurable

#has_option?, included, #register_deprecated_instance_option, #register_instance_option

Methods included from Proxyable

#with

Constructor Details

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

Instance Method Details

#method_nameObject



30
31
32
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 30

def method_name
  nested_form ? "#{self.name}_attributes" : association[:foreign_key]
end

#multiple?Boolean

Returns:



34
35
36
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 34

def multiple?
  false
end

#selected_idObject



26
27
28
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 26

def selected_id
  bindings[:object].send(foreign_key)
end