aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/date_helper.rb
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2012-03-26 21:46:30 +0300
committerSergey Nartimov <just.lest@gmail.com>2012-03-26 21:46:30 +0300
commit65434a2f259e94ebacccd1166e5d6a93d0b77732 (patch)
tree1776dff1a0aed4c71c08ae0ea298dd65a8a6cc65 /actionpack/lib/action_view/helpers/date_helper.rb
parent65f4d8019f63ff384b0ecfe25b6f5f829151de9a (diff)
downloadrails-65434a2f259e94ebacccd1166e5d6a93d0b77732.tar.gz
rails-65434a2f259e94ebacccd1166e5d6a93d0b77732.tar.bz2
rails-65434a2f259e94ebacccd1166e5d6a93d0b77732.zip
apply form_for namespace option to date_select
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 2bfc6371f5..45e5a862b6 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -977,7 +977,10 @@ module ActionView
# Returns the id attribute for the input tag.
# => "post_written_on_1i"
def input_id_from_type(type)
- input_name_from_type(type).gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '')
+ id = input_name_from_type(type).gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '')
+ id = @options[:namespace] + '_' + id if @options[:namespace]
+
+ id
end
# Given an ordering of datetime components, create the selection HTML