新手问题 slim 的问题

1272729223 · October 03, 2012 · Last by 1272729223 replied at October 03, 2012 · 2276 hits

现在的 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 恰好补下知识,对着文档一个个试

You need to Sign in before reply, if you don't have an account, please Sign up first.