在我的Rails模板中,我想使用HAML完成最终的HTML:
I will first <a href="http://example.com">link somewhere</a>, then render this half of the sentence if a condition is met
即将发布的模板:
I will first
= link_to 'link somewhere', 'http://example.com'
- if @condition
, then render this half of the sentence if a condition is met
但是,您可能会注意到,这会在链接和逗号之间产生一个空格.有什么切实可行的方法来避免这种空白吗?我知道有一些语法可以删除标签周围的空白,但这种语法可以只应用于文本吗?我真的不喜欢用额外的标记来实现这一点.