采用UTF-8解决Ruby on Rails程序的中问题
1.将.rb文件和.rhtml文件都保存为utf-8格式;
2.在/app/Controller/application.rb中增加如下代码:
ruby 代码
2.在/app/Controller/application.rb中增加如下代码:
ruby 代码
代码如下:
before_filter :set_charset def set_charset headers["Content-Type"] = "text/html; charset=UTF-8" end
相关推荐
何志文 2020-05-11
JOO 2020-04-26
龙浩然 2014-06-03
yohunl 2008-01-11
wujiajax 2011-07-22
samllQ的备忘录 2011-07-22
wl00 2020-10-28
EricNet 2020-07-05
EricNet 2020-05-27
happyfreeangel 2020-04-09
Poisedflw 2020-03-23
yangliuhbhd 2020-03-06
Ben的程序员生涯 2013-06-01
chenshuixian 2013-06-01
wes0 2014-05-31
mrice00 2019-12-20
EricNet 2019-12-11