Module: NitroKit::RadioButtonHelper

Defined in:
app/helpers/nitro_kit/radio_button_helper.rb

Instance Method Summary collapse

Instance Method Details

#nk_radio_button(compat_object_name = nil, compat_method = nil, compat_tag_value = nil, compat_options = {}, label: nil, **attrs) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/helpers/nitro_kit/radio_button_helper.rb', line 5

def nk_radio_button(
  compat_object_name = nil,
  compat_method = nil,
  compat_tag_value = nil,
  compat_options = {},
  label: nil,
  **attrs
)
  name = field_name(compat_object_name, compat_method)
  value = compat_tag_value || attrs[:value]

  render(RadioButton.from_template(label:, name:, value:, **attrs))
end

#nk_radio_button_group(**attrs, &block) ⇒ Object



19
20
21
# File 'app/helpers/nitro_kit/radio_button_helper.rb', line 19

def nk_radio_button_group(**attrs, &block)
  render(RadioButtonGroup.from_template(**attrs), &block)
end