Module: Jav::Concerns::HasEditableControls

Extended by:
ActiveSupport::Concern
Included in:
BaseResource
Defined in:
lib/jav/concerns/has_editable_controls.rb

Instance Method Summary collapse

Instance Method Details

#has_show_controls?Boolean

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/jav/concerns/has_editable_controls.rb', line 12

def has_show_controls?

  self.class.show_controls.present?
end

#render_show_controlsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/jav/concerns/has_editable_controls.rb', line 17

def render_show_controls

  if show_controls.present?
    Jav::Resources::Controls::ExecutionContext.new(
      block: show_controls,
      resource: self,
      record: model,
      view: view
    ).handle&.items || []
  else
    []
  end
end