aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/text.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/template/text.rb')
-rw-r--r--actionpack/lib/action_view/template/text.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/template/text.rb b/actionpack/lib/action_view/template/text.rb
index f7d0df5ba0..f6e011a5ab 100644
--- a/actionpack/lib/action_view/template/text.rb
+++ b/actionpack/lib/action_view/template/text.rb
@@ -1,6 +1,8 @@
module ActionView #:nodoc:
class TextTemplate < String #:nodoc:
- def initialize(string, content_type = Mime[:html])
+ HTML = Mime[:html]
+
+ def initialize(string, content_type = HTML)
super(string.to_s)
@content_type = Mime[content_type] || content_type
end
@@ -14,11 +16,11 @@ module ActionView #:nodoc:
end
def inspect
- 'inline template'
+ 'text template'
end
def render(*args)
- self
+ to_s
end
def mime_type