本文介绍了“h"是什么意思?在“<%=h[...]%>"中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我生成默认脚手架时,show.html.erb 上的显示标签有
When I generate a default scaffold, the display tags on show.html.erb have
<%=h @broker.name %>
我知道 和
之间的区别.h"是做什么的?
I know the difference between
<%
and <%=
. What's the "h" do?
推荐答案
推荐答案
html 转义.这是一种转换诸如 < 之类的东西的方法.和 > 转换为数字字符引用,以便渲染不会破坏您的 html.
html escape. It's a method that converts things like < and > into numerical character references so that rendering won't break your html.
这篇关于“h"是什么意思?在“<%=h[...]%>"中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!