简体   繁体   English

从Rails中的ruby循环中删除双引号

[英]Remove double quotes from ruby loop in rails

I am working on a ruby on rails web app and in my view I have the following code: 我正在开发Rails Web应用程序上的ruby,在我看来,我有以下代码:

<div id="glmol02" style="width: 600px; height: 400px; background-color: black;"></div> <textarea id="glmol02_src" style="display: none;">
<% @name.coords.each_with_index do |coord, i| %>
  <%= coord.atom %>
<% end %>
END
</textarea>

When I look at my web page, there are double quotes around the whole for loop, how can I remove those double quotes? 当我查看网页时,整个for循环中都有双引号,如何删除这些双引号?

<div></div>
<textarea>
" entry1
  entry2
  ...
  entry100 "
</textarea>

Thanks so much! 非常感谢!

Chrome's inspector (for example, other browsers might do this too) adds pseudo-quotes to elements if they're beginning or ending with a whitespace/tabs/etc to indicate their presence. Chrome的检查器(例如,其他浏览器也可能这样做),如果元素以空格/ tabs / etc开头或结尾以指示其存在,则在元素中添加伪引号。 Similar behaviour can apply to <p> and <div> . 类似的行为可以应用于<p><div>

Have you checked the website's actual source with CTRL+U , or are you just using the inspector? 您是否已使用CTRL+U检查了网站的实际来源,还是仅使用检查器?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM