新手问题 slim 的问题

1272729223 · 2012年10月03日 · 最后由 1272729223 回复于 2012年10月03日 · 2257 次阅读

现在的 erb 是这样的:

<li class="<%= "active" unless first_photo(@photo) %> thumb">

转换成 slim 怎么写?谢谢

li.thumb class=("active" unless first_photo(@photo))

li class="#{"active" unless first_photo(@photo)} thumb"

谢谢 哈哈!节日快乐!

li *{:class => "#{"active" unless first_photo(@photo)} thumb"}

这么多种方式?

li class=[("active" unless first_photo(@photo)), 'thumb']

#5 楼 @1272729223 恰好补下知识,对着文档一个个试

需要 登录 后方可回复, 如果你还没有账号请 注册新账号