From 9dae645c5f8a2aaa70b19e05daf9a7d270facb72 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 3 Mar 2010 00:42:51 -0800 Subject: Actually move ImplicitRender into it's own file --- actionpack/lib/action_controller.rb | 1 + actionpack/lib/action_controller/base.rb | 23 ---------------------- .../lib/action_controller/metal/implicit_render.rb | 21 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 23 deletions(-) create mode 100644 actionpack/lib/action_controller/metal/implicit_render.rb diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb index 759e52b135..a449a3364c 100644 --- a/actionpack/lib/action_controller.rb +++ b/actionpack/lib/action_controller.rb @@ -20,6 +20,7 @@ module ActionController autoload :Helpers autoload :HideActions autoload :HttpAuthentication + autoload :ImplicitRender autoload :Instrumentation autoload :MimeResponds autoload :RackDelegation diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 13139358c7..aec14165b6 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -36,29 +36,6 @@ module ActionController # Add instrumentations hooks at the bottom, to ensure they instrument # all the methods properly. include ActionController::Instrumentation - - # TODO: Extract into its own module - # This should be moved together with other normalizing behavior - module ImplicitRender - def send_action(*) - ret = super - default_render unless response_body - ret - end - - def default_render - render - end - - def method_for_action(action_name) - super || begin - if view_paths.exists?(action_name.to_s, details_for_render, controller_path) - "default_render" - end - end - end - end - include ImplicitRender include ActionController::Rescue diff --git a/actionpack/lib/action_controller/metal/implicit_render.rb b/actionpack/lib/action_controller/metal/implicit_render.rb new file mode 100644 index 0000000000..ba2d9b686e --- /dev/null +++ b/actionpack/lib/action_controller/metal/implicit_render.rb @@ -0,0 +1,21 @@ +module ActionController + module ImplicitRender + def send_action(*) + ret = super + default_render unless response_body + ret + end + + def default_render + render + end + + def method_for_action(action_name) + super || begin + if view_paths.exists?(action_name.to_s, details_for_render, controller_path) + "default_render" + end + end + end + end +end \ No newline at end of file -- cgit v1.2.3