diff options
author | Hongli Lai (Phusion) <hongli@phusion.nl> | 2008-11-18 20:45:55 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-18 11:50:31 -0800 |
commit | 337c361e26fe5647036f94556fe792535a921f93 (patch) | |
tree | b584abbf5c02f7ad0b9f138ed75771c98721129b /actionpack/lib/action_view | |
parent | 19e9a1f47db89fc94b1c1f0e8bd533c9e925f4d1 (diff) | |
download | rails-337c361e26fe5647036f94556fe792535a921f93.tar.gz rails-337c361e26fe5647036f94556fe792535a921f93.tar.bz2 rails-337c361e26fe5647036f94556fe792535a921f93.zip |
Register 'checked' as an HTML boolean attribute.
This way, 'tag :foo, :type => "checkbox", :checked => false' would output
the expected
<input type="checkbox" />
instead of the old
<input type="checkbox" checked="false" />
The latter would result in a checkbox that's initially checked.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/tag_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index d37ca766af..1c8d2db183 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -9,7 +9,7 @@ module ActionView module TagHelper include ERB::Util - BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple).to_set + BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple checked).to_set BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map(&:to_sym)) # Returns an empty HTML tag of type +name+ which by default is XHTML |