# Boolean values passed to content\_tag?

**URL:** <https://www.ruby-forum.com/t/boolean-values-passed-to-content-tag/126853>\
**Category:** Rails\
**Created:** [January 22, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/boolean-values-passed-to-content-tag/126853 "2008-01-22T20:20:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin\_cline](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3d9bf3/32.png) [@kevin\_cline](https://www.ruby-forum.com/u/kevin_cline)\
**Post date:** [January 22, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/boolean-values-passed-to-content-tag/126853/1 "2008-01-22T20:20:25Z")

</div>

In Rails 1.2.3, if I call content\_tag(‘input’, :type =\>  
‘checkbox’, :checked =\> true, :disabled =\> true), I get

```
<input type="checkbox" checked="true" disabled="disabled">

```

I expected content\_tag to handle all boolean values in the same way,  
to give me:

but instead content\_tag\_string only converts the “disabled”,  
“readonly”, and “multiple” attributes. This seems rather fragile, as  
it requires RAILS to track HTML.

Why not convert all ‘true’ values to match the attribute name, and  
remove all ‘false’ values?
