Haml: Control whitespace around text

前端 未结 13 2146
时光说笑
时光说笑 2020-11-30 16:38

In my Rails template, I\'d like to accomplish final HTML to this effect using HAML:

I will first link somewhere         


        
13条回答
  •  一整个雨季
    2020-11-30 17:33

    The solution that I got working is:

    I will first
    = link_to 'link somewhere', 'http://example.com'
    - if @condition
      = ", then render this half of the sentence if a condition is met"
    

    You can use =, though = is used to output the result of Rails code, but here it will server the purpose.

提交回复
热议问题