# Bug?

**URL:** <https://www.ruby-forum.com/t/bug/135899>\
**Category:** Rails\
**Created:** [April 26, 2008, 12:24am UTC](https://www.ruby-forum.com/t/bug/135899 "2008-04-26T00:24:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 26, 2008, 12:24am UTC](https://www.ruby-forum.com/t/bug/135899/1 "2008-04-26T00:24:17Z")

</div>

radio\_button\_tag(:school\_type, type, ‘’)

=\> “\<input checked=“checked” id=“school\_type\_online”  
name=“school\_type” type=“radio” value=“online” /\>”

Note that I passed it a default value of ‘’ and it spit out that it that  
my radio button was checked. Is that right?  
-R

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 26, 2008, 12:30am UTC](https://www.ruby-forum.com/t/bug/135899/2 "2008-04-26T00:30:23Z")

</div>

On 25 Apr 2008, at 23:24, Roger P. wrote:

> radio\_button\_tag(:school\_type, type, ‘’)
> 
> =\> “\<input checked=“checked” id=“school\_type\_online”  
> name=“school\_type” type=“radio” value=“online” /\>”
> 
> Note that I passed it a default value of ‘’ and it spit out that it  
> that  
> my radio button was checked. Is that right?  
> The third parameter is whether or not the radio is checked. false and  
> nil are false in ruby, everything else (including an empty string) is  
> true, and so your radio button gets checked.

Fred
