From 2caf4d5a9337591c2728c7db826526febc5b2158 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 17 Sep 2006 16:20:32 +0000 Subject: Added proper getters and setters for content type and charset [DHH] Added utf-8 as the default charset for all renders. You can change this default using ActionController::Base.default_charset=(encoding) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5129 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/base.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_view/base.rb') diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 2f12bdb3c4..5d1bf57c94 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -1,7 +1,6 @@ require 'erb' module ActionView #:nodoc: - class ActionViewError < StandardError #:nodoc: end @@ -441,11 +440,11 @@ module ActionView #:nodoc: if template_requires_setup?(extension) body = case extension.to_sym when :rxml + "@controller.response.content_type ||= 'application/xml'\n" + "xml = Builder::XmlMarkup.new(:indent => 2)\n" + - "@controller.headers['Content-Type'] ||= 'application/xml'\n" + template when :rjs - "@controller.headers['Content-Type'] ||= 'text/javascript'\n" + + "@controller.response.content_type ||= 'text/javascript'\n" + "update_page do |page|\n#{template}\nend" end else @@ -526,4 +525,4 @@ module ActionView #:nodoc: end end -require 'action_view/template_error' +require 'action_view/template_error' \ No newline at end of file -- cgit v1.2.3