Class: ExtForm::Helpers::Tags::AutoComplete

Inherits:
ActionView::Helpers::Tags::TextField
  • Object
show all
Defined in:
lib/ext_form/helpers/tags/auto_complete.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.field_typeObject



18
19
20
# File 'lib/ext_form/helpers/tags/auto_complete.rb', line 18

def self.field_type
  'text'
end

Instance Method Details

#renderObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ext_form/helpers/tags/auto_complete.rb', line 6

def render
  output = super

  html_options = {}
  add_default_name_and_id(html_options)

  output << @template_object.javascript_tag do
    "$(function(){$('##{html_options['id']}').trigger('auto_complete_load');});".html_safe
  end
  output.html_safe
end