Ruby on Rails – 这个符号是什么意思:erb中的?
刚刚生成的设计视图,并在生成的erb.html
找到:
什么 ..
,我知道这是一个猴子的问题,但我不知道要搜索哪个关键字。所以我来到无敌Stackoverflow的帮助..
吃空格,使渲染的HTML看起来更好。
您可以将Ruby代码放在<%%>中
<% Ruby code -- inline with output %> <%= Ruby expression -- replace with result %> <%# comment -- ignored -- useful in testing %> % a line of Ruby code -- treated as <% line %> (optional -- see ERB.new) %% replaced with % if first thing on a line and % processing is used <%% or %%> -- replace with <% or %> respectively
参考: http : //ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/ERB.html