aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/base.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-23 15:58:38 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-27 11:49:11 -0700
commitcecafc52ee0a4a53c903ddbaba95683261f88e5f (patch)
tree4cc1f0d246a313b2a2fa78747b3265bdbd901c22 /actionpack/lib/action_controller/base/base.rb
parentda3c21ead59cb47b8f4c69c6bd95f225a9c8b479 (diff)
downloadrails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.tar.gz
rails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.tar.bz2
rails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.zip
Refactor ActionView::Template
ActionView::Template is now completely independent from template storage, which allows different back ends such as the database. ActionView::Template's only responsibility is to take in the template source (passed in from ActionView::Path), compile it, and render it.
Diffstat (limited to 'actionpack/lib/action_controller/base/base.rb')
-rw-r--r--actionpack/lib/action_controller/base/base.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/base/base.rb b/actionpack/lib/action_controller/base/base.rb
index 1d0738588d..2063df54b4 100644
--- a/actionpack/lib/action_controller/base/base.rb
+++ b/actionpack/lib/action_controller/base/base.rb
@@ -494,8 +494,18 @@ module ActionController #:nodoc:
end
protected :filter_parameters
end
+
+ @@exempt_from_layout = [ActionView::TemplateHandlers::RJS]
+
+ def exempt_from_layout(*types)
+ types.each do |type|
+ @@exempt_from_layout <<
+ ActionView::Template.handler_class_for_extension(type)
+ end
+
+ @@exempt_from_layout
+ end
- delegate :exempt_from_layout, :to => 'ActionView::Template'
end
public
@@ -856,13 +866,13 @@ module ActionController #:nodoc:
return (performed? ? ret : default_render) if called
begin
- default_render
- rescue ActionView::MissingTemplate => e
- raise e unless e.action_name == action_name
- # If the path is the same as the action_name, the action is completely missing
+ view_paths.find_by_parts(action_name, {:formats => formats, :locales => [I18n.locale]}, controller_path)
+ rescue => e
raise UnknownAction, "No action responded to #{action_name}. Actions: " +
"#{action_methods.sort.to_sentence}", caller
end
+
+ default_render
end
# Returns true if a render or redirect has already been performed.