Class: Uchi::Field::Base::Edit

Inherits:
Component
  • Object
show all
Defined in:
app/components/uchi/field/base.rb

Overview

Uchi::Field::Base::Edit components render fields in the edit view.

Instance Attribute Summary collapse

Attributes inherited from Component

#field, #record, #repository

Instance Method Summary collapse

Methods inherited from Component

#value

Methods included from RoutesHelper

#uchi_path_to

Constructor Details

#initialize(field:, form:, repository:, label: nil, hint: nil) ⇒ Edit

Returns a new instance of Edit.



32
33
34
35
36
37
# File 'app/components/uchi/field/base.rb', line 32

def initialize(field:, form:, repository:, label: nil, hint: nil)
  super(field:, record: form.object, repository:)
  @form = form
  @label = label
  @hint = hint
end

Instance Attribute Details

#form ⇒ Object (readonly)

Returns the value of attribute form.



30
31
32
# File 'app/components/uchi/field/base.rb', line 30

def form
  @form
end

#hint ⇒ Object (readonly)

Returns the value of attribute hint.



30
31
32
# File 'app/components/uchi/field/base.rb', line 30

def hint
  @hint
end

#label ⇒ Object (readonly)

Returns the value of attribute label.



30
31
32
# File 'app/components/uchi/field/base.rb', line 30

def label
  @label
end