Class: Shoelace::Components::SlRange

Inherits:
ActionView::Helpers::Tags::NumberField
  • Object
show all
Includes:
ErrorWrappable
Defined in:
app/helpers/shoelace/components/sl_range.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from ErrorWrappable

#error_wrapping

Instance Method Details

#field_typeObject



10
# File 'app/helpers/shoelace/components/sl_range.rb', line 10

def field_type; nil; end

#renderObject



12
13
14
15
# File 'app/helpers/shoelace/components/sl_range.rb', line 12

def render
  @options["invalid"] = @options["data-invalid"] = "" if object_has_errors?
  super
end

#tag(tag_name, *args, &block) ⇒ Object



17
18
19
# File 'app/helpers/shoelace/components/sl_range.rb', line 17

def tag(tag_name, *args, &block)
  tag_name.to_s == 'input' ? ('sl-range', '', *args, &block) : super
end