aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-15 11:21:30 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-15 11:21:30 +0100
commit4593cc9e546878d69f795ce75808aae60656213c (patch)
tree32bbe8feca8beaa5f6be2487cc5b7f877486a0c6 /app/controllers/application_controller.rb
parente37dceb05e564b4d90b75a8c3eacff90b8ad3d14 (diff)
Add a comment to explain why we're calling `set_view_paths` in the controller when the method doesn't exist in Alaveteli code. See [this comment](https://github.com/sebbacon/alaveteli/issues/320#issuecomment-5711523) for discussion.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index e354b64a4..47accae1c 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -118,8 +118,11 @@ class ApplicationController < ActionController::Base
# Override default error handler, for production sites.
def rescue_action_in_public(exception)
- # Make sure expiry time for session is set (before_filters are
- # otherwise missed by this override)
+ # Call `set_view_paths` from the theme, if it exists.
+ # 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
@@ -127,6 +130,8 @@ class ApplicationController < ActionController::Base
raise
end
end
+ # Make sure expiry time for session is set (before_filters are
+ # otherwise missed by this override)
session_remember_me
case exception
when ActiveRecord::RecordNotFound, ActionController::UnknownAction, ActionController::RoutingError