加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 内联HAML链接,但内容很多

发布时间:2020-12-17 04:33:59 所属栏目:百科 来源:网络整理
导读:我试图输出一些东西 pHello,this is my text. a href="#"Link here/a This is more text/p 但是使用HAML 这怎么办?我一直在寻找示例,但没有一个显示如何做到但链接的任何一侧都有纯文本? 尼尔 解决方法 如果你想做一个班轮: %p= "Hello,this is my text.
我试图输出一些东西
<p>Hello,this is my text. <a href="#">Link here</a> This is more text</p>

但是使用HAML

这怎么办?我一直在寻找示例,但没有一个显示如何做到但链接的任何一侧都有纯文本?

尼尔

解决方法

如果你想做一个班轮:
%p= "Hello,this is my text. #{link_to 'Link here','#'} This is more text".html_safe

多行

%p 
  Hello,this is my text. 
  = link_to 'Link here','#'
  This is more text

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读