如何注释 rails html.erb 文件中的行? [英] How to comment lines in rails html.erb files?

查看:50
本文介绍了如何注释 rails html.erb 文件中的行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Rails 的新手,请让我知道注释掉一行以及注释掉的方法*.html.erb 文件中的一行行.

Am a newbie to rails , please let me know the way to comment out a single line and also to comment out a block of lines in *.html.erb files.

推荐答案

ruby on rails notes 有一篇关于在 erb 文件中评论的非常好的博文

ruby on rails notes has a very nice blogpost about commenting in erb-files

简短版本是

注释单行使用

<%# commented line %>

要评论整个块,请使用 if false 像这样包围您的代码

to comment a whole block use a if false to surrond your code like this

<% if false %>
code to comment
<% end %>

这篇关于如何注释 rails html.erb 文件中的行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆