aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-11-20 15:30:40 +0000
committerLouise Crow <louise.crow@gmail.com>2012-11-20 15:30:40 +0000
commit766da660994dbe7c86f556d9cf863411814622fe (patch)
tree9adc0ef695cb076216e8ebb15ab29b56ef9bbf15 /app/controllers/application_controller.rb
parent8b4003f7fce9e089f2220e6f1a21681f7cf2df3d (diff)
parent21f4341619ae1b076521e04f2124ef86fd2b7b5f (diff)
Merge remote-tracking branch 'origin/develop' into wdtk
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 3f3c169ae..f9649c868 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -117,17 +117,14 @@ class ApplicationController < ActionController::Base
# Override default error handler, for production sites.
def rescue_action_in_public(exception)
- # Call `set_view_paths` from the theme, if it exists.
+ # Looks for before_filters called something like `set_view_paths_{themename}`. These
+ # are set by the themes.
# Normally, this is called by the theme itself in a
# :before_filter, but when there's an error, this doesn't
# happen. By calling it here, we can ensure error pages are
# still styled according to the theme.
- begin
- set_view_paths
- rescue NameError => e
- if !(e.message =~ /undefined local variable or method `set_view_paths'/)
- raise
- end
+ ActionController::Base.before_filters.select{|f| f.to_s =~ /set_view_paths/}.each do |f|
+ self.send(f)
end
# Make sure expiry time for session is set (before_filters are
# otherwise missed by this override)