Class: Daisy::DataInput::RatingComponent::RatingItemComponent

Inherits:
LocoMotion::BasicComponent show all
Defined in:
app/components/daisy/data_input/rating_component.rb

Overview

Inner component for rendering individual rating items as radio inputs.

Instance Method Summary collapse

Methods inherited from LocoMotion::BasicComponent

name

Instance Method Details

#before_renderObject

Sets up the component before rendering.



40
41
42
43
# File 'app/components/daisy/data_input/rating_component.rb', line 40

def before_render
  set_tag_name(:component, :input)
  add_html(:component, { name: loco_parent.name, type: "radio" })
end

#callString

Renders the component with the appropriate attributes. Takes the name from the parent component and sets the type to radio.

Returns:

  • (String)

    The rendered HTML for the rating item.



51
52
53
# File 'app/components/daisy/data_input/rating_component.rb', line 51

def call
  part(:component)
end