Your template was not saved as valid UTF-8. 解决方法

在操作ROR文件的时候,由于编辑器的原因,可能会遇到Your template was not saved as valid UTF-8.错误,解决方法如下:

1. 在文件头加上# encoding: utf-8

2.在application.rb 文件里加上 config.encoding = "utf-8"
3. 在 application.html.erb 文件里加上<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


posted @ 2013-05-26 08:44  小楼  阅读(468)  评论(0编辑  收藏  举报