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
然而,您可能会注意到这会在链接和逗号之间产生一个空格。有没有什么实际的方法可以避免这个空白?我知道有一种语法可以删除标签周围的空格,但是这种语法是否也可以应用于纯文本?我真的不喜欢使用额外的标记来完成这个任务。
succeed
)来表达OP的示例?对我来说,它仍然看起来不太明显且有点丑陋:https://gist.github.com/1665374 - John@condition == false
,尾随逗号也会被呈现出来,这比在逗号前加上空格更丑陋。 - Nash Bridges