Class: DatepickerInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
app/inputs/datepicker_input.rb

Instance Method Summary collapse

Instance Method Details

#datepicker_options(value = nil) ⇒ Object



6
7
8
# File 'app/inputs/datepicker_input.rb', line 6

def datepicker_options(value = nil)
  datepicker_options = {:class => 'input-small datepicker string', :value => value.nil?? nil : value.strftime("%d/%m/%Y")}
end

#inputObject



2
3
4
# File 'app/inputs/datepicker_input.rb', line 2

def input
  "#{@builder.text_field(attribute_name, input_html_options.merge(datepicker_options(object.send(attribute_name))))}".html_safe
end