a tiny refactoring
This commit is contained in:
parent
eb7fdc6e10
commit
1e3b1acbdd
|
@ -2,8 +2,8 @@ class SeparateDateAndTimePickerInput < Formtastic::Inputs::DatetimePickerInput
|
|||
def to_html
|
||||
input_wrapping do
|
||||
label_html <<
|
||||
builder.text_field("#{method}(date)", date_input_html_options) <<
|
||||
builder.text_field("#{method}(time)", time_input_html_options)
|
||||
builder.text_field(date_method, date_input_html_options) <<
|
||||
builder.text_field(time_method, time_input_html_options)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -16,6 +16,14 @@ class SeparateDateAndTimePickerInput < Formtastic::Inputs::DatetimePickerInput
|
|||
{ 'type' => 'time', 'value' => time_value }
|
||||
end
|
||||
|
||||
def date_method
|
||||
"#{method}(date)"
|
||||
end
|
||||
|
||||
def time_method
|
||||
"#{method}(time)"
|
||||
end
|
||||
|
||||
def date_value
|
||||
value_parts.first
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue