Class: FormProps::Inputs::SearchField

Inherits:
TextField
  • Object
show all
Defined in:
lib/form_props/inputs/search_field.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #json

Constructor Details

This class inherits a constructor from FormProps::Inputs::Base

Instance Method Details

#renderObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/form_props/inputs/search_field.rb', line 6

def render
  if @options[:autosave]
    if @options[:autosave] == true
      @options[:autosave] = request.host.split(".").reverse.join(".")
    end
    @options[:results] ||= 10
  end

  if @options[:onsearch]
    @options[:incremental] = true unless @options.has_key?(:incremental)
  end

  super
end