Class: Phlexi::Form::Components::RadioButton

Inherits:
Input show all
Defined in:
lib/phlexi/form/components/radio_button.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #field

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Phlexi::Form::Components::Base

Instance Method Details

#extract_inputObject



11
12
13
14
# File 'lib/phlexi/form/components/radio_button.rb', line 11

def extract_input(...)
  # when a radio is not submitted, nothing is returned
  super.compact
end

#view_templateObject



7
8
9
# File 'lib/phlexi/form/components/radio_button.rb', line 7

def view_template
  input(**attributes, value: @checked_value)
end