diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-15 11:38:33 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-15 11:38:36 +0100 |
commit | 5097146ff016b2aaa9d3dc29f3ec65db0aadbb72 (patch) | |
tree | aff7422269c160ab15277e7913646aed1ca32bb5 /app/controllers/application_controller.rb | |
parent | 95e7cd60a2ff78aa8550dc1855ee7c01a0f4c6f2 (diff) | |
parent | 362b1cfdab4115478034e004c85001bb6d7abd68 (diff) |
Merge branch 'feature/fix-404-in-themes' into develop
Fixes #320 and fixes #56 - thanks @jms301!
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7e0096179..e305e90f4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -118,6 +118,18 @@ 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. + # 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 + end # Make sure expiry time for session is set (before_filters are # otherwise missed by this override) session_remember_me |