Class: AgileFormFields::DateSelect
- Inherits:
-
AgileFormField
- Object
- AgileFormField
- AgileFormFields::DateSelect
- Defined in:
- app/models/agile_form_fields/date_select.rb
Overview
Implementation of date_select AgileRails form field.
===Form options:
type:date_select (required)name:Field name (required)options:options which apply to date_select field (optional)html:html options which apply to password field (optional)
Form example:
50:
name: valid_from
type: date_select
options:
include_blank: true
html:
class: my-date-class
Instance Attribute Summary
Attributes inherited from AgileFormField
Class Method Summary collapse
-
.get_data(params, name) ⇒ Object
DatetimeSelect get_data method.
Instance Method Summary collapse
-
#render ⇒ Object
Render date_select field html code.
Methods inherited from AgileFormField
#hash_to_options, #html, #initialize, #options_to_hash, #record_text_for, #ro_standard, #set_css_code, #set_default_value, #set_initial_value, #set_style, #t
Constructor Details
This class inherits a constructor from AgileFormFields::AgileFormField
Class Method Details
.get_data(params, name) ⇒ Object
DatetimeSelect get_data method.
63 64 65 |
# File 'app/models/agile_form_fields/date_select.rb', line 63 def self.get_data(params, name) DatetimeSelect.get_data(params, name).to_date rescue nil end |
Instance Method Details
#render ⇒ Object
Render date_select field html code
48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/models/agile_form_fields/date_select.rb', line 48 def render #return ro_standard( @env.agile_format_value(@record[@yaml['name']])) if @readonly # @yaml['options'] ||= {} set_initial_value('options','default') @yaml['options'].symbolize_keys! @yaml['html'].symbolize_keys! record = record_text_for(@yaml['name']) @html += @env.date_select(record, @yaml['name'], @yaml['options'], @yaml['html']) self end |