So a nil value prevents that key from being rendered.. perfect!
Thanks,
Aman Gupta
On Nov 1, 2:58 am, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> No. That's invalid XHTML. The valid way to do that would be
>
> %input{:type => "radio", :checked => @added ? true : nil, :disabled =>
> @added ? nil : true}
>
> A shorter but harder to read way would be
>
> %input{:type => "radio", :checked => @added || nil, :disabled =>
> [EMAIL PROTECTED] || nil}
>
> - Nathan
>
> Aman Gupta wrote:
> > I want to set the checked and disabled setting on a input type="radio"
> > based on a variable.. is this possible? Something equivalent to
>
> > %(<input type="radio" #{ @added ? 'checked' : 'disabled' }/>)
>
> > Aman Gupta
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---