如何使用 slim 模板语言在段落中间放置超链接?

发布于 2024-12-06 11:18:01 字数 426 浏览 0 评论 0原文

如何用 slim 模板语言编写以下内容?

<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>

我尝试了以下方法:

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

但这不起作用,因为“组”和“和”一词之间没有空格。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仄言 2024-12-13 11:18:01

显然你可以在引用后添加额外的空格:

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

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
如痴如狂 2024-12-13 11:18:01

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

Rails 标签助手只是方法,因此您可以将该逻辑应用于视图内的其他方法

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文