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