Module: JqueryUiForm::Inputs::SelectInput

Included in:
FormBuilder
Defined in:
lib/jquery_ui_form/inputs/select_input.rb

Constant Summary collapse

SELECT_OPTIONS =
%w(selected include_blank disabled required)

Instance Method Summary collapse

Instance Method Details

#select(method, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jquery_ui_form/inputs/select_input.rb', line 9

def select(method, options = {})
  choices = options.delete(:collection)
  if options[:value]
    options[:selected] = options.delete(:value)
  end
  html_options = options.delete(:html) || {}
  options.each do |key,value|
    html_options[key] = options.delete(key) unless SELECT_OPTIONS.include?(key.to_s)
  end
  super(method, choices, options, html_options)
end

#select_input(method, options = {}) ⇒ Object



5
6
7
# File 'lib/jquery_ui_form/inputs/select_input.rb', line 5

def select_input(method, options = {})
  basic_input_helper(:select, :select, method, options)   
end