Class: Arara::Tags::RadioButton
- Inherits:
-
ActionView::Helpers::Tags::Base
- Object
- ActionView::Helpers::Tags::Base
- Arara::Tags::RadioButton
- Includes:
- ActionView::Helpers::Tags::Checkable
- Defined in:
- app/components/arara/tags/radio_button.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(object_name, method_name, template_object, tag_value, options) ⇒ RadioButton
constructor
A new instance of RadioButton.
- #render ⇒ Object
Constructor Details
#initialize(object_name, method_name, template_object, tag_value, options) ⇒ RadioButton
Returns a new instance of RadioButton.
10 11 12 13 |
# File 'app/components/arara/tags/radio_button.rb', line 10 def initialize(object_name, method_name, template_object, tag_value, ) @tag_value = tag_value super(object_name, method_name, template_object, ) end |
Instance Method Details
#render ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/components/arara/tags/radio_button.rb', line 15 def render = @options.stringify_keys ["type"] = "radio" ["value"] = @tag_value ["checked"] = "checked" if input_checked?() add_default_name_and_id_for_value(@tag_value, ) @template_object.template.render(Arara::RadioButtonComponent, .symbolize_keys) end |