Permalink
Browse files

Actually move ImplicitRender into it's own file

  • Loading branch information...
1 parent 6feffe5 commit 9dae645c5f8a2aaa70b19e05daf9a7d270facb72 Carl Lerche committed Mar 3, 2010
@@ -20,6 +20,7 @@ module ActionController
autoload :Helpers
autoload :HideActions
autoload :HttpAuthentication
+ autoload :ImplicitRender
autoload :Instrumentation
autoload :MimeResponds
autoload :RackDelegation
@@ -36,29 +36,6 @@ class Base < Metal
# 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
@@ -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

0 comments on commit 9dae645

Please sign in to comment.