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

ruby-on-rails – 该行比前一行缩进了2级. HAML

发布时间:2020-12-17 02:59:50 所属栏目:百科 来源:网络整理
导读:=image_tag('/images/public_stream_page/overlay_image.png',:onload="document.getElementById('dd_mid_right_box_public').style.background='url(#{stream.asset.url(:normal)})';") 这是我显示图像的haml代码 所以我得到了这个错误 The line was indent
=image_tag('/images/public_stream_page/overlay_image.png',:onload=>"document.getElementById('dd_mid_right_box_public').style.background='url(#{stream.asset.url(:normal)})';")

这是我显示图像的haml代码
所以我得到了这个错误

The line was indented 2 levels deeper than the previous line.

怎么解决?

解决方法

您没有以正确的方式显示与空间缩进相关的问题的代码…
行号也有帮助.
你应该有这样的东西:

- if stream.asset? 
  =image_tag('/images/public_stream_page/overlay_image.png',:onload=>"document.getElementById('dd_mid_right_box_public').style.background='url(#{stream.asset.url(:normal)})';")

第二行缩进时,您在其余的模板中使用相同数量的间距,而可能有一行(错误中未显示的数字)缩进2倍.

(编辑:李大同)

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

    推荐文章
      热点阅读