[前][次][番号順一覧][スレッド一覧]

rails:240

From: take_tk <ggb03124@n...>
Date: Mon, 04 Jul 2005 13:32:05 +0900
Subject: [rails:240] <%=h ... %> の "h" は何でしょうか?

たけ(tk)です

[Rails] what does the "h" in <%=h ... %> means? Sat, 02 Jul 2005 14:24:31 +0800

what does the "h" in <%=h ... %> means?

Example: <%=h category.send(column.name) %>

It seems like I can do with or without the "h".

---

ときどき見かける <%=h ... %> の "h" は何でしょうか?

----

h() and html_escape() is part of ERb, not Rails. It actually does the  
following gsubs:

gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</,  
"&lt;")

----

h() は html_escape() の別名で(?)、ERb の一部です。
次のような変換を行います。

gsub(/&/, "&amp;").
gsub(/\"/, "&quot;").
gsub(/>/, "&gt;").
gsub(/</,  "&lt;")

Take_tk = KUMAGAI Hidetake
たけ(tk)=熊谷秀武



--
ML: rails@r...
使い方: http://QuickML.com/

[前][次][番号順一覧][スレッド一覧]