aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
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:53:10 +0300
commitbd8a9701c27b4261e9d8dd84aebbde6ba784ed83 (patch)
treeba3e8093a4980246205c99611395a9db9eecc40c /actionpack/lib/action_view/helpers
parented7567ca7aa4ea3f29236229f4c1d366550a0c5c (diff)
downloadrails-bd8a9701c27b4261e9d8dd84aebbde6ba784ed83.tar.gz
rails-bd8a9701c27b4261e9d8dd84aebbde6ba784ed83.tar.bz2
rails-bd8a9701c27b4261e9d8dd84aebbde6ba784ed83.zip
apply form_for namespace option to date_select
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-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 2b128e8445..c26f0d4911 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -940,7 +940,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