Class: Plutonium::UI::Display::Components::Association

Inherits:
Phlexi::Display::Components::Association
  • Object
show all
Includes:
Component::Methods
Defined in:
lib/plutonium/ui/display/components/association.rb

Instance Method Summary collapse

Instance Method Details

#render_value(value) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/plutonium/ui/display/components/association.rb', line 10

def render_value(value)
  p(**attributes) {
    if registered_resources.include?(value.class)
      href = resource_url_for(value, parent: (field.association_reflection.macro == :has_many) ? field.object : nil)
      a(class: themed(:link), href:) {
        display_name_of value
      }
    else
      display_name_of value
    end
  }
end