开发者

How to put a hyperlink in the middle of a paragraph using the slim templating language?

How do you write the following in the slim templating language?

开发者_如何转开发
<p>Join the <a href="">Google group</a> and let us know what you think, or what other features you’d like to see.</p>

I tried the following:

p
  ' Join the
  a href="" Google Group
  ' and let us know what you think, or what other features you’d like to see

But that doesn't work because the words 'Group' and 'and' do not have whitespace between them.


Apparently you can add extra spaces after the quote:

p
  ' Join the
  a href="" Google Group
  '  and let us know what you think, or what other features you’d like to see


You can do

 p This is a paragraph with a link #{link_to 'embedded', 'http://google.com'}.

Rails tag helpers are just methods, so you can apply that logic to other methods inside views.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜