Sha256: 405241dd414f714a34b8523fa8e4f3a141875d8fc7fba1b3bee62609d22cd421
Contents?: true
Size: 891 Bytes
Versions: 2
Compression:
Stored size: 891 Bytes
Contents
# The filters added to this controller will be run for all controllers in the application. # Likewese will all the methods added be available for all controllers. require 'login_engine' class ApplicationController < ActionController::Base include LoginEngine model :user before_filter :set_charset after_filter :fix_unicode_for_safari after_filter OutputCompressionFilter # automatically and transparently fixes utf-8 bug # with Safari when using xmlhttp def fix_unicode_for_safari if @headers["Content-Type"] == "text/html; charset=utf-8" and @request.env['HTTP_USER_AGENT'].to_s.include? 'AppleWebKit' then @response.body = @response.body.gsub(/([^\x00-\xa0])/u) { |s| "&#x%x;" % $1.unpack('U')[0] } end end def set_charset #@headers["Content-Type"] = "text/html; charset=iso-8859-15" @headers["Content-Type"] = "text/html; charset=utf-8" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
parlement-0.7 | app/controllers/application.rb |
parlement-0.8 | app/controllers/application.rb |