Class: DateTimeComponent
- Inherits:
-
BaseComponent
- Object
- AbstractController::Base
- Puffer::Component::Base
- BaseComponent
- DateTimeComponent
- Defined in:
- app/components/date_time_component.rb
Instance Attribute Summary
Attributes inherited from Puffer::Component::Base
#field, #identifer, #opts, #parent_controller, #record, #records, #resource
Instance Method Summary collapse
Methods inherited from Puffer::Component::Base
#component_id, #event_options, #event_path, #event_url, #fallback_action, #initialize, #javascript_wrap, #method_for_action, #process, #render, #replace
Methods included from Puffer::Component::Base::ClassMethods
Constructor Details
This class inherits a constructor from Puffer::Component::Base
Instance Method Details
#filter ⇒ Object
13 14 15 16 |
# File 'app/components/date_time_component.rb', line 13 def filter @format = time_format render end |
#form ⇒ Object
8 9 10 11 |
# File 'app/components/date_time_component.rb', line 8 def form @format = time_format render end |
#index ⇒ Object
3 4 5 6 |
# File 'app/components/date_time_component.rb', line 3 def index date = super date.to_s(field.[:format].presence || :db) if date.present? end |