aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-25 09:04:33 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-25 09:04:33 -0700
commit67153430861ca1305d77a73e631a9038049fbfa9 (patch)
treef3cc50274fca7d62002ad0852527cc6f122266be /actionpack/lib/action_view
parentdfb5898b6dd448a6867dcd26ebcbe0835b26a1e2 (diff)
parent130fe2b172afb81979e72fbf30edf945147cb78f (diff)
downloadrails-67153430861ca1305d77a73e631a9038049fbfa9.tar.gz
rails-67153430861ca1305d77a73e631a9038049fbfa9.tar.bz2
rails-67153430861ca1305d77a73e631a9038049fbfa9.zip
Merge pull request #7435 from nashby/fix-issue-7431
correct handling of date selects when using both disabled and discard options
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 096ad12892..795440cacc 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -963,12 +963,15 @@ module ActionView
# build_hidden(:year, 2008)
# => "<input id="post_written_on_1i" name="post[written_on(1i)]" type="hidden" value="2008" />"
def build_hidden(type, value)
- (tag(:input, {
+ select_options = {
:type => "hidden",
:id => input_id_from_type(type),
:name => input_name_from_type(type),
:value => value
- }.merge(@html_options.slice(:disabled))) + "\n").html_safe
+ }.merge(@html_options.slice(:disabled))
+ select_options.merge!(:disabled => 'disabled') if @options[:disabled]
+
+ tag(:input, select_options) + "\n".html_safe
end
# Returns the name attribute for the input tag.