Class: FormtasticDateTimePickerInput
- Inherits:
-
Formtastic::Inputs::StringInput
- Object
- Formtastic::Inputs::StringInput
- FormtasticDateTimePickerInput
- Defined in:
- lib/generators/files_for_generator/formtastic_date_time_picker_input.rb
Overview
This input file serves as the custom input for any formtastic forms that may or may not exist in the host application.
Instance Method Summary collapse
Instance Method Details
#to_html ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/files_for_generator/formtastic_date_time_picker_input.rb', line 5 def to_html input_wrapping do [:label] = {:for => [:id], :class => "control-label"} in_modal = ["data-in-modal"] ? .delete("data-in-modal") : nil close_javascript_support = ["data-close-js-support"] ? .delete("data-close-js-support") : nil out = '<div class="text control-group">' out << (render_label? ? builder.label(input_name, label_text, ) : "") out << '<div class="controls">' out << before_dtp_html out << builder.text_field(method, ) out << after_dtp_html if in_modal || close_javascript_support out << js_because_of_jquery_requirements end out << "</div></div>" out.html_safe end end |