aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/handlers/rjs.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-01-22 16:18:10 -0600
committerJoshua Peek <josh@joshpeek.com>2009-01-22 16:18:10 -0600
commiteb9af20b7cc0e374277cf330bdd404f9daab28ec (patch)
treeba05a906690684e442ed92db3e63e295f0dd133e /actionpack/lib/action_view/template/handlers/rjs.rb
parentcc0b5fa9930dcc60914e21b518b3c54109243cfa (diff)
downloadrails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.tar.gz
rails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.tar.bz2
rails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.zip
Begin unifying the interface between ActionController and ActionView
Diffstat (limited to 'actionpack/lib/action_view/template/handlers/rjs.rb')
-rw-r--r--actionpack/lib/action_view/template/handlers/rjs.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template/handlers/rjs.rb b/actionpack/lib/action_view/template/handlers/rjs.rb
new file mode 100644
index 0000000000..802a79b3fc
--- /dev/null
+++ b/actionpack/lib/action_view/template/handlers/rjs.rb
@@ -0,0 +1,13 @@
+module ActionView
+ module TemplateHandlers
+ class RJS < TemplateHandler
+ include Compilable
+
+ def compile(template)
+ "@formats = [:html];" +
+ "controller.response.content_type ||= Mime::JS;" +
+ "update_page do |page|;#{template.source}\nend"
+ end
+ end
+ end
+end