Append class if condition is true in Haml (with Rails) - Stack Overflow http://t.co/7pyL7pNn
— kinopyo (@fantasyday) November 22, 2011
.post{ :class => ('gray' unless post.published?) }
HAMLである条件がtrueの時だけあるclassをタグに追加したい場合。
Append class if condition is true in Haml (with Rails) - Stack Overflow http://t.co/7pyL7pNn
— kinopyo (@fantasyday) November 22, 2011
.post{ :class => ('gray' unless post.published?) }
HAMLである条件がtrueの時だけあるclassをタグに追加したい場合。