开发者

rails 3: what does the h() in "content_for(:title) { h(page_title.to_s) }" do?

开发者 https://www.devze.com 2023-03-14 23:44 出处:网络
My app is using a view helper than adds a layout helper that contains the code content_for(:title) { h(page_title.to_s) }

My app is using a view helper than adds a layout helper that contains the code

content_for(:title) { h(page_title.to_s) }

and I'm trying to modify it somewhat but have开发者_如何学C no idea what the h() means?


It is an ERB method to escape the HTML. See the ERB docs for more info about it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号