From f21a528f5508430bf9281dffe938bda6c9fbd84b Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 15 Jun 2012 17:17:21 +0200 Subject: Remove Mime::Type translations from Action View Action View should not be responsible for translating mime types. Any translation that's needed should be handled at controller level. --- actionpack/lib/action_view/template/text.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_view/template/text.rb') diff --git a/actionpack/lib/action_view/template/text.rb b/actionpack/lib/action_view/template/text.rb index 3af76dfcdb..b629faaa9a 100644 --- a/actionpack/lib/action_view/template/text.rb +++ b/actionpack/lib/action_view/template/text.rb @@ -2,12 +2,11 @@ module ActionView #:nodoc: # = Action View Text Template class Template class Text #:nodoc: - attr_accessor :mime_type + attr_accessor :type - def initialize(string, mime_type = nil) - @string = string.to_s - @mime_type = Mime[mime_type] || mime_type if mime_type - @mime_type ||= Mime::TEXT + def initialize(string, type = nil) + @string = string.to_s + @type = type || :text end def identifier @@ -27,7 +26,7 @@ module ActionView #:nodoc: end def formats - [@mime_type.to_sym] + [@type.to_sym] end end end -- cgit v1.2.3