aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/handlers
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2012-05-13 20:22:29 -0400
committerSteve Klabnik <steve@steveklabnik.com>2012-05-17 12:14:20 -0500
commit8bea607265a2c9bb9bb2188b0a79089ca373b814 (patch)
tree61002877ed6a54499d95b957a23e3a5b183cd577 /actionpack/lib/action_view/template/handlers
parent1839ecd2288680dba8533610eb4c9dfe2ab6326e (diff)
downloadrails-8bea607265a2c9bb9bb2188b0a79089ca373b814.tar.gz
rails-8bea607265a2c9bb9bb2188b0a79089ca373b814.tar.bz2
rails-8bea607265a2c9bb9bb2188b0a79089ca373b814.zip
Created a Raw handler for templates.
Fixes #2394
Diffstat (limited to 'actionpack/lib/action_view/template/handlers')
-rw-r--r--actionpack/lib/action_view/template/handlers/raw.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template/handlers/raw.rb b/actionpack/lib/action_view/template/handlers/raw.rb
new file mode 100644
index 0000000000..0c0d1fffcb
--- /dev/null
+++ b/actionpack/lib/action_view/template/handlers/raw.rb
@@ -0,0 +1,11 @@
+module ActionView
+ module Template::Handlers
+ class Raw
+ def call(template)
+ escaped = template.source.gsub(':', '\:')
+
+ '%q:' + escaped + ':;'
+ end
+ end
+ end
+end