Class: DateTimePickerInput

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

Overview

app/inputs/date_time_picker_input.rb

Instance Method Summary collapse

Instance Method Details

#icon_calendarObject



25
26
27
# File 'app/inputs/date_time_picker_input.rb', line 25

def icon_calendar
  "<i class='fa fa fa-calendar'></i>".html_safe
end

#inputObject



4
5
6
7
8
9
10
11
12
13
# File 'app/inputs/date_time_picker_input.rb', line 4

def input
  template.(:div, class: 'form-group') do
    template.(:div, class: 'input-group date') do
      template.concat span_calendar
      template.concat @builder.text_field(attribute_name, input_html_options)
      #template.concat span_remove
      #template.concat span_table
    end
  end
end

#input_html_optionsObject



15
16
17
# File 'app/inputs/date_time_picker_input.rb', line 15

def input_html_options
  {class: 'form-control', readonly: true}
end

#span_calendarObject



19
20
21
22
23
# File 'app/inputs/date_time_picker_input.rb', line 19

def span_calendar
  template.(:span, class: 'input-group-addon') do
    template.concat icon_calendar
  end
end