diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-22 17:07:40 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-22 17:08:58 -0700 |
commit | 7b3fb1d43f57d6ebe3edb75434cae01e140483d0 (patch) | |
tree | 746afe7ee685cdf0750443d7afde9d838cbbe22b /actionpack/lib | |
parent | 3a72b55229f63d2cba3337c39cd118cf532ebbbc (diff) | |
download | rails-7b3fb1d43f57d6ebe3edb75434cae01e140483d0.tar.gz rails-7b3fb1d43f57d6ebe3edb75434cae01e140483d0.tar.bz2 rails-7b3fb1d43f57d6ebe3edb75434cae01e140483d0.zip |
Got controller/render_js_test.rb to pass on new base
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/new_base/base.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_controller/new_base/render_options.rb | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/new_base/base.rb b/actionpack/lib/action_controller/new_base/base.rb index e321d97ac1..adb760ea7e 100644 --- a/actionpack/lib/action_controller/new_base/base.rb +++ b/actionpack/lib/action_controller/new_base/base.rb @@ -12,6 +12,7 @@ module ActionController include ActionController::Redirector include ActionController::Renderer include ActionController::Renderers::Json + include ActionController::Renderers::Js include ActionController::Renderers::Xml include ActionController::Renderers::Rjs include ActionController::Layouts diff --git a/actionpack/lib/action_controller/new_base/render_options.rb b/actionpack/lib/action_controller/new_base/render_options.rb index 2ce9d0c7ae..33f8957f6e 100644 --- a/actionpack/lib/action_controller/new_base/render_options.rb +++ b/actionpack/lib/action_controller/new_base/render_options.rb @@ -62,6 +62,16 @@ module ActionController end end + module Js + include RenderOption + register_renderer :js + + def _render_js(js, options) + response.content_type ||= Mime::JS + self.response_body = js + end + end + module Xml include RenderOption register_renderer :xml |