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 您可能感兴趣的文章:Ruby rails 页面跳转(render和redirect_to)学习Ruby你需要了解的相关知识(rvm, gem, bundle, rake, rail