ror支持中文

xiaoxiao2025-12-10  4

在app文件中的application.rb 文件中增加过滤方法, before_filter :configure_charsets def configure_charsets # @headers["Content-Type"] = "text/html; charset=utf-8" @response.headers["Content-Type"] = "text/html; charset=utf-8" # Set connection charset. MySQL 4.0 doesn??t support this so it #will throw an error, MySQL 4.1 needs this suppress(ActiveRecord::StatementInvalid) do ActiveRecord::Base.connection.execute 'SET NAMES utf8' end end 相关资源:敏捷开发V1.0.pptx
转载请注明原文地址: https://www.6miu.com/read-5040651.html

最新回复(0)