aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags/date_select.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/tags/date_select.rb')
-rw-r--r--actionpack/lib/action_view/helpers/tags/date_select.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/date_select.rb b/actionpack/lib/action_view/helpers/tags/date_select.rb
index 2f2681bf65..5912598ca1 100644
--- a/actionpack/lib/action_view/helpers/tags/date_select.rb
+++ b/actionpack/lib/action_view/helpers/tags/date_select.rb
@@ -9,11 +9,15 @@ module ActionView
end
def render
- error_wrapping(datetime_selector(@options, @html_options).select_date.html_safe)
+ error_wrapping(datetime_selector(@options, @html_options).send("select_#{select_type}").html_safe)
end
private
+ def select_type
+ self.class.name.split("::").last.sub("Select", "").downcase
+ end
+
def datetime_selector(options, html_options)
datetime = value(object) || default_datetime(options)
@auto_index ||= nil