---
title: "在controller里面怎么escape html内容？"
author: "AllenYoung"
date: "2007-07-24T10:24:54Z"
tags: ["CGI", "HTML", "MySQL", "Ruby", "json"]
slug: "controller-escape-html"
draft: false
lastmod: "2007-07-24T10:24:54Z"
id: 104662
url: "https://allenyoung.iteye.com/blog/104662"
---

在view里面可以用h来escape html内容。那在controller里面呢？我的需求是把一些数据用json格式发送到前台，这些数据是用户之前输入的。