Haml print at same line

我的梦境 提交于 2019-12-13 23:27:13

问题


I want to print HAML at same line

  %ul
    - @categories.each do |c|
      %li= c.name 
      (#{c.posts.count})

and I recive

<ul>
  <li>vim</li>
  (3)
  <li>bash</li>
  (1)
</ul>

How to get

<ul>
  <li>vim(3)<li>
  <li>bash(1)</li>
</ul>

回答1:


Something like this should work:

%li= "#{c.name} (#{c.posts.count})"


来源:https://stackoverflow.com/questions/8591796/haml-print-at-same-line

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!