Module: FlexaFormtasticBootstrap::Inputs::Base::Timeish
- Included in:
- DateInput, DatePickerInput, DatetimeInput, TimeInput
- Defined in:
- lib/flexa_formtastic_bootstrap/inputs/base/timeish.rb
Instance Method Summary collapse
- #date_input_html ⇒ Object
- #fragment_id(fragment) ⇒ Object
- #fragment_input_html(fragment, klass) ⇒ Object
- #label_html ⇒ Object
- #time_input_html ⇒ Object
Instance Method Details
#date_input_html ⇒ Object
13 14 15 |
# File 'lib/flexa_formtastic_bootstrap/inputs/base/timeish.rb', line 13 def date_input_html fragment_input_html(:date, "small") end |
#fragment_id(fragment) ⇒ Object
21 22 23 24 25 |
# File 'lib/flexa_formtastic_bootstrap/inputs/base/timeish.rb', line 21 def fragment_id(fragment) # TODO is this right? # "#{input_html_options[:id]}_#{position(fragment)}i" "#{[:id]}[#{fragment}]" end |
#fragment_input_html(fragment, klass) ⇒ Object
27 28 29 30 |
# File 'lib/flexa_formtastic_bootstrap/inputs/base/timeish.rb', line 27 def fragment_input_html(fragment, klass) opts = .merge(:prefix => object_name, :field_name => fragment_name(fragment), :default => value, :include_blank => include_blank?) template.send(:"text_field_#{fragment}", value, opts, .merge(:id => fragment_id(fragment), :class => klass)) end |
#label_html ⇒ Object
6 7 8 9 10 11 |
# File 'lib/flexa_formtastic_bootstrap/inputs/base/timeish.rb', line 6 def label_html # TODO Supress the "for" field? template.content_tag(:label, ) do render_label? ? label_text : "".html_safe end end |
#time_input_html ⇒ Object
17 18 19 |
# File 'lib/flexa_formtastic_bootstrap/inputs/base/timeish.rb', line 17 def time_input_html fragment_input_html(:time, "mini") end |