Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 如何使用超薄模板语言在段落的中间放置超链接?_Ruby_Templates_Slim Lang - Fatal编程技术网

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

Ruby 如何使用超薄模板语言在段落的中间放置超链接?,ruby,templates,slim-lang,Ruby,Templates,Slim Lang,如何用模板语言编写以下内容 <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> 但这不起作用,因为单词“Group”和“and”之间没有空格。显然,您可以在引号后添加额外的空格: p ' Join the a href="" Google Group '

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

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

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

显然,您可以在引号后添加额外的空格:

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

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

Rails标记帮助程序只是方法,因此您可以将该逻辑应用于视图中的其他方法。

这是正确的。报价后的空格将成为您的左边距。你可以随意在行首添加任意多的空格。这种语法让我有点想吐。哇,让我们用另一个答案。
 p This is a paragraph with a link #{link_to 'embedded', 'http://google.com'}.