diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-08-01 14:39:18 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-08-01 14:39:18 +0100 |
commit | 67a3a43cc26f8ad7218f33a13af04c3c74347866 (patch) | |
tree | 3fc5f27905332ba4647915eb5823d3d37615fe4c /app/controllers/application_controller.rb | |
parent | c1d2580892033d28ff05f3d47cee78aaef963c29 (diff) | |
parent | cc3268df4c9de319ea16aa99238e3c4c40dae7c5 (diff) |
Merge branch 'develop' into wdtk
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 41adf1848..a124743b2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -27,6 +27,7 @@ class ApplicationController < ActionController::Base before_filter :check_in_post_redirect before_filter :session_remember_me before_filter :set_vary_header + before_filter :set_popup_banner # scrub sensitive parameters from the logs filter_parameter_logging :password @@ -133,6 +134,10 @@ class ApplicationController < ActionController::Base # Make sure expiry time for session is set (before_filters are # otherwise missed by this override) session_remember_me + + # Make sure the locale is set correctly too + set_gettext_locale + case exception when ActiveRecord::RecordNotFound, ActionController::UnknownAction, ActionController::RoutingError @status = 404 @@ -156,6 +161,9 @@ class ApplicationController < ActionController::Base # otherwise missed by this override) session_remember_me + # Make sure the locale is set correctly too + set_gettext_locale + # Display default, detailed error for developers original_rescue_action_locally(exception) end @@ -553,6 +561,9 @@ class ApplicationController < ActionController::Base return country end + def set_popup_banner + @popup_banner = render_to_string(:partial => "general/popup_banner").strip + end # URL generating functions are needed by all controllers (for redirects), # views (for links) and mailers (for use in emails), so include them into # all of all. |