Conditionally render attribute

3 views
Skip to first unread message

dnagir

unread,
Aug 4, 2009, 1:06:56 AM8/4/09
to nhaml-users
Hi,

I need to render checked attribute depending on some value.

Currently it takes a lot of code code snippet to write:
- if (IsChecked)
%input { type="checkbox" value=#{LongCalculatedValue()}
checked="checked"}
-else
%input { type="checkbox" value=#{LongCalculatedValue()} }

How can I CONDITIONALLY render the attribute here?

Cheers,
Dmitriy.
Reply all
Reply to author
Forward
0 new messages