Module: Railsstrap::Helpers::DatePicker
- Defined in:
- lib/railsstrap/helpers/date_picker_helper.rb
Instance Method Summary collapse
- #date_picker(options = {}) ⇒ Object
- #date_picker_icon(options = {}) ⇒ Object
- #date_picker_input(options = {}) ⇒ Object
- #date_picker_javascript(options = {}) ⇒ Object
Instance Method Details
#date_picker(options = {}) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/railsstrap/helpers/date_picker_helper.rb', line 25 def date_picker( = {}) opts = .deep_merge() content_tag(:div, class: "input-group date #{opts[:class]}", id: opts[:id], data: opts[:data]) { opts[:show_input] ? date_picker_input(opts) + date_picker_icon(opts) : date_picker_icon(opts) } end |
#date_picker_icon(options = {}) ⇒ Object
32 33 34 35 |
# File 'lib/railsstrap/helpers/date_picker_helper.rb', line 32 def date_picker_icon( = {}) opts = .deep_merge() content_tag opts[:icon_wrapper_tag], icon(opts[:icon]), class: opts[:icon_wrapper_class] end |
#date_picker_input(options = {}) ⇒ Object
37 38 39 40 |
# File 'lib/railsstrap/helpers/date_picker_helper.rb', line 37 def date_picker_input( = {}) opts = .deep_merge() text_field_tag opts[:input_name], '', class: opts[:input_class] end |
#date_picker_javascript(options = {}) ⇒ Object
42 43 44 45 |
# File 'lib/railsstrap/helpers/date_picker_helper.rb', line 42 def date_picker_javascript( = {}) opts = .deep_merge() javascript_tag "(function ($) { $('#{opts[:selector]}').datetimepicker(#{opts.to_json});})(jQuery);" end |