aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2011-12-14 23:20:23 +0300
committerSergey Nartimov <just.lest@gmail.com>2011-12-14 23:20:23 +0300
commitcaa1c1978733b6271309db5af488c39aacff6c5a (patch)
tree7bcee193934b56eec46db15c48a6d03fb8ed06f6 /actionpack/lib/action_view
parent889e8bee82ea4f75adb6de5badad512d2c615b7f (diff)
downloadrails-caa1c1978733b6271309db5af488c39aacff6c5a.tar.gz
rails-caa1c1978733b6271309db5af488c39aacff6c5a.tar.bz2
rails-caa1c1978733b6271309db5af488c39aacff6c5a.zip
fix separator insertion in date_select helper
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 38cf922ef4..dd2b59cb0a 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -947,8 +947,9 @@ module ActionView
# and join them with their appropriate separators.
def build_selects_from_types(order)
select = ''
+ first_visible = order.find { |type| !@options[:"discard_#{type}"] }
order.reverse.each do |type|
- separator = separator(type) unless type == order.first # don't add on last field
+ separator = separator(type) unless type == first_visible # don't add before first visible field
select.insert(0, separator.to_s + send("select_#{type}").to_s)
end
select.html_safe