↧
Answer by regularfry for How do I add 2 conditional classes to a div?
I don't know if it's "right" per se, but this should work::class => [list.overdue? ? "progress-danger" : nil, list.dirty? ? "progress-warning" : nil].compact.join("")
View ArticleAnswer by Arpit Vaishnav for How do I add 2 conditional classes to a div?
Why dont you take it to a helper View code .progress{ :class => check_list_over_due }Helper Codedef check_list_over_due if condition'classname' elsif condition'classname' else'classname' endend
View ArticleAnswer by VadimAlekseev for How do I add 2 conditional classes to a div?
I think the best way is to write helper, like "progress_bar_class(list)" and implement all logic in light structurized code.
View ArticleHow do I add 2 conditional classes to a div?
Here is my div. What is the syntax for adding another conditional class?.progress{ :class => list.overdue? ? "progress-danger" : "" }I essential want to add list.dirty? ? "progress-warning" : ""But...
View Article
More Pages to Explore .....