Skip to content

Commit

Permalink
Option :update_elements for SimpleForm implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
raskhadafi committed Nov 25, 2011
1 parent 2464cc5 commit 292b5b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rails3-jquery-autocomplete/simple_form_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module SimpleForm
module Inputs
class AutocompleteInput < Base
def input
@builder.autocomplete_field(attribute_name, options[:url], input_html_options)
@builder.autocomplete_field(attribute_name, options[:url], input_html_options.merge(update_elements(options[:update_elements])))
end

protected
Expand All @@ -14,6 +14,10 @@ def limit
def has_placeholder?
placeholder_present?
end

def update_elements(elements)
{'data-update-elements' => elements.to_json}
end
end
end
end
Expand Down

0 comments on commit 292b5b6

Please sign in to comment.