Module: ActionView::Helpers::FormTagHelper
- Defined in:
- lib/rails3-jquery-autocomplete/form_helper.rb
Instance Method Summary collapse
-
#autocomplete_field_tag(name, value, source, options = {}) ⇒ Object
Creates a standard text field that can be populated with jQuery’s autocomplete plugin.
- #original_text_field_tag ⇒ Object
- #text_field_tag(name, value = nil, options = {}) ⇒ Object
Instance Method Details
#autocomplete_field_tag(name, value, source, options = {}) ⇒ Object
Creates a standard text field that can be populated with jQuery’s autocomplete plugin
Examples
autocomplete_field_tag 'address', '', address_autocomplete_path, :size => 75
# => <input id="address" name="address" size="75" type="text" value="" data-autocomplete="address/autocomplete"/>
34 35 36 37 |
# File 'lib/rails3-jquery-autocomplete/form_helper.rb', line 34 def autocomplete_field_tag(name, value, source, ={}) [:autocomplete] = source text_field_tag(name, value, ) end |
#original_text_field_tag ⇒ Object
23 |
# File 'lib/rails3-jquery-autocomplete/form_helper.rb', line 23 alias_method :original_text_field_tag, :text_field_tag |
#text_field_tag(name, value = nil, options = {}) ⇒ Object
24 25 26 |
# File 'lib/rails3-jquery-autocomplete/form_helper.rb', line 24 def text_field_tag(name, value = nil, = {}) original_text_field_tag(name, value, rename_autocomplete_option()) end |