dash在RubyonRails html脚本中是什么意思?
在网上,我看到了这两个例子dash在RubyonRails html脚本中是什么意思?,html,ruby-on-rails,ruby,scriptlet,Html,Ruby On Rails,Ruby,Scriptlet,在网上,我看到了这两个例子 <% if @showIt -%> some html content <% end -%> 一些html内容 没有 <% if @showIt %> some html content <% end %> 一些html内容 冲刺。两个版本都工作得很好。那么,这有什么区别呢? 谢谢 用于避免在代码后插入换行符 我找到了一个很好的解释。上面的链接似乎断了,在stack post中解释得很好谢谢,不知何故
<% if @showIt -%>
some html content
<% end -%>
一些html内容
没有
<% if @showIt %>
some html content
<% end %>
一些html内容
冲刺。两个版本都工作得很好。那么,这有什么区别呢?谢谢 用于避免在代码后插入换行符
我找到了一个很好的解释。上面的链接似乎断了,在stack post中解释得很好谢谢,不知何故谷歌搜索没有帮到我:)