Sha256: 104133f5624a69fc0377a161c9f4d610293fb19714947262941e455d28b564a4

Contents?: true

Size: 708 Bytes

Versions: 9

Compression:

Stored size: 708 Bytes

Contents

module FormHelpers
  class InstanceTag
    def to_auto_complete(options = {})
      send(:add_default_name_and_id, options)
      @template_object.auto_complete_field(options['id'], options)
    end

    def to_text_field_with_auto_complete(options = {}, text_field_options = {})
      to_input_field_tag('text', text_field_options) + to_auto_complete(options)
    end
  end

  class FormBuilder
    def text_field_with_auto_complete(method, options = {}, auto_complete_options = {})
      text_field(method, options) + auto_complete_for(method, auto_complete_options)
    end

    def auto_complete_for(method, options = {})
      @template.auto_complete_for(@object_name, method, options)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree-0.11.4 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.11.3 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.11.2 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.11.1 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.11.0 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.10.2 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.10.1 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.10.0 vendor/plugins/jrails_auto_complete/lib/form_helpers.rb
spree-0.10.0.beta vendor/plugins/jrails_auto_complete/lib/form_helpers.rb