1.将.rb文件和.rhtml文件都保存为utf-8格式;
2.在/app/Controller/application.rb中增加如下代码:
ruby 代码
before_filter :set_charset
def set_charset
headers["Content-Type"] = "text/html; charset=UTF-8"
end
1.将.rb文件和.rhtml文件都保存为utf-8格式;
2.在/app/Controller/application.rb中增加如下代码:
ruby 代码
before_filter :set_charset
def set_charset
headers["Content-Type"] = "text/html; charset=UTF-8"
end