Sha256: 1276583241301b0bd733176d0f6f074f0ec6f67baa899e30f0060c698e955a28

Contents?: true

Size: 612 Bytes

Versions: 11

Compression:

Stored size: 612 Bytes

Contents

module JqueryUiForm 
  module Inputs
    module SelectInput
      SELECT_OPTIONS = %w(selected include_blank disabled required)
      def select_input(method, options = {})
        basic_input_helper(:select, :select, method, options)   
      end
      
      def select(method, options = {})
        choices = options.delete(:collection)
        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
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jquery-ui-form-0.2.3 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.2.2 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.2.1 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.2.0 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.1.6 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.1.5 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.1.4 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.1.3 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.1.2 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.1.1 lib/jquery_ui_form/inputs/select_input.rb
jquery-ui-form-0.1.0 lib/jquery_ui_form/inputs/select_input.rb