Class: ActionView::Helpers::FormBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_auto_complete.rb

Instance Method Summary collapse

Instance Method Details

#helpersObject



16
17
18
# File 'lib/simple_auto_complete.rb', line 16

def helpers
  ActionController::Base.helpers
end

#text_field_with_auto_complete(method, collection = [], options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/simple_auto_complete.rb', line 9

def text_field_with_auto_complete(method, collection = [], options = {})
  helpers. :div, 
    @template.text_field(@object_name, method, options) + 
    helpers.(:div, helpers.(:ul, "", :class => "select-ul"), :class => "select-list"),
    :class => "auto-complete", "data-list" => collection.to_s
end