Class: Formtastic::Inputs::RegexInput

Inherits:
StringInput
  • Object
show all
Defined in:
lib/formtastic/regex-input.rb

Instance Method Summary collapse

Instance Method Details

#input_html_optionsObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/formtastic/regex-input.rb', line 5

def input_html_options

  {
      class: 'regex-input',
      data: {
          regex: options[:regex],
          example: options[:example]
      },
      placeholder_text: options[:example]
  }
end

#input_wrapping(&block) ⇒ Object

Overwrite default li tag



18
19
20
21
22
23
# File 'lib/formtastic/regex-input.rb', line 18

def input_wrapping(&block)
  template.(:div,
                      [template.capture(&block), error_html, hint_html].join("\n").html_safe,
                      wrapper_html_options
  )
end

#wrapper_html_optionsObject

Overwrite wrapper html by the active admin class



26
27
28
# File 'lib/formtastic/regex-input.rb', line 26

def wrapper_html_options
  super.merge(:class => 'filter_form_field filter_string')
end