Class: Shoelace::Rails::Ui::FormHelper::ShoelaceSwitch

Inherits:
ActionView::Helpers::Tags::TextField
  • Object
show all
Defined in:
app/helpers/shoelace/rails/ui/form_helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#field_typeObject



78
# File 'app/helpers/shoelace/rails/ui/form_helper.rb', line 78

def field_type; nil; end

#render(&block) ⇒ Object



80
81
82
83
84
85
86
# File 'app/helpers/shoelace/rails/ui/form_helper.rb', line 80

def render(&block)
  options = @options.stringify_keys
  options["value"] = options.fetch("value") { value_before_type_cast }
  add_default_name_and_id(options)

  @template_object.('sl-switch', @method_name.to_s.humanize, options, &block)
end