aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/base.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-18 11:54:51 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-18 11:54:51 -0700
commitcf6e025a4538e488ed35f61f1f7f3498833a34e6 (patch)
tree6a28d5beac35e74a33243668baf7a9a60edf6724 /actionpack/lib/action_controller/new_base/base.rb
parent628110d7eeb446fee7f9e043f113c083d24883c1 (diff)
parent195fadbfd31294d43634afb7bbf4f0ffc86b470a (diff)
downloadrails-cf6e025a4538e488ed35f61f1f7f3498833a34e6.tar.gz
rails-cf6e025a4538e488ed35f61f1f7f3498833a34e6.tar.bz2
rails-cf6e025a4538e488ed35f61f1f7f3498833a34e6.zip
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/lib/action_controller/new_base/base.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/base.rb42
1 files changed, 29 insertions, 13 deletions
diff --git a/actionpack/lib/action_controller/new_base/base.rb b/actionpack/lib/action_controller/new_base/base.rb
index 1adcc9c71f..c25ffd5c84 100644
--- a/actionpack/lib/action_controller/new_base/base.rb
+++ b/actionpack/lib/action_controller/new_base/base.rb
@@ -12,14 +12,40 @@ module ActionController
include ActionController::Renderer
include ActionController::Layouts
include ActionController::ConditionalGet
-
+
# Legacy modules
include SessionManagement
include ActionDispatch::StatusCodes
-
+
# Rails 2.x compatibility
include ActionController::Rails2Compatibility
-
+
+ # TODO: Extract into its own module
+ # This should be moved together with other normalizing behavior
+ module ImplicitRender
+ def process_action(method_name)
+ ret = super
+ render if response_body.nil?
+ ret
+ end
+
+ def _implicit_render
+ render
+ end
+
+ def method_for_action(action_name)
+ super || begin
+ if view_paths.find_by_parts?(action_name.to_s, {:formats => formats, :locales => [I18n.locale]}, controller_path)
+ "_implicit_render"
+ end
+ end
+ end
+ end
+
+ include ImplicitRender
+
+ include ActionController::Rescue
+
def self.inherited(klass)
::ActionController::Base.subclasses << klass.to_s
super
@@ -113,15 +139,5 @@ module ActionController
super(url, status)
end
-
- def process_action
- ret = super
- render if response_body.nil?
- ret
- end
-
- def respond_to_action?(action_name)
- super || view_paths.find_by_parts?(action_name.to_s, {:formats => formats, :locales => [I18n.locale]}, controller_path)
- end
end
end \ No newline at end of file