Class: Uchi::Field::BelongsTo::Show

Inherits:
Uchi::Field::Base::Show show all
Includes:
Helpers
Defined in:
app/components/uchi/field/belongs_to.rb

Instance Attribute Summary

Attributes inherited from Uchi::Field::Base::Component

#field, #record, #repository

Instance Method Summary collapse

Methods included from Helpers

#associated_record, #associated_repository, #label_for_associated_record

Methods inherited from Uchi::Field::Base::Component

#initialize, #value

Constructor Details

This class inherits a constructor from Uchi::Field::Base::Component

Instance Method Details

#path_to_show_associated_recordObject



98
99
100
101
102
# File 'app/components/uchi/field/belongs_to.rb', line 98

def path_to_show_associated_record
  associated_repository
    .routes
    .path_for(:show, id: associated_record.id)
end

#render?Boolean

Returns:



104
105
106
# File 'app/components/uchi/field/belongs_to.rb', line 104

def render?
  associated_record.present?
end