The trick is that you can use ruby expansion in attributes like it were a
normal ruby string.
<card class="milestone #{'late' if this.late?}" ... though you can make it
even simpler if you change the late? method (or add a new one) in the model
to return 'late' if late and nil if not. Then it becomes class="milestone
#{this.late?}"
If you have a more complicated class string based on multiple values this
method is definitely cleaner on the view. Just add the additional
conditions (and probably rename) the method.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" 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/hobousers?hl=en.