Sha256: b27017aeba7c83397b0a92b3dcf51a2266c79f65328c3a4d70d33a7ce2334cee

Contents?: true

Size: 993 Bytes

Versions: 34

Compression:

Stored size: 993 Bytes

Contents

module FlexaLib
  module Inputs
    class DatePickerInput < Formtastic::Inputs::StringInput
    
      def to_html
        input_wrapping do
          options[:lookup].inspect if options[:lookup].present?
          label_html << 
          builder.text_field(options[:lookup][:display], input_html_options) <<
          template.link_to(options[:lookup][:display],options[:lookup][:path],{:target=>"_blank",:class=>"btn"})<<
          builder.hidden_field(method, {})
        end
      end
    
      def label_html_options
        {}.tap do |opts|
          opts[:for] ||= input_html_options[:id]
          opts[:class] = [opts[:class]]
        end
      end
    
      #def input_html_options
      #  super.reject { |k, v| [:min, :max, :step].include?(k) }
      #end
    
      def wrapper_html_options
        super.merge(:class => "#{super[:class]} datePicker" )
      end
        
      def input_html_options
        super.merge(:class => "datePicker")
      end
    
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
flexa_lib-0.3.3 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.3.2 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.3.1 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.3.0 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.9 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.8 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.7 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.6 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.5 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.4 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.3 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.2 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.1 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.2.0 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.1.21 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.1.20 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.1.19 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.1.18 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.1.17 lib/flexa_lib/inputs/date_picker_input.rb
flexa_lib-0.1.16 lib/flexa_lib/inputs/date_picker_input.rb