diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-09 21:34:15 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-09 21:34:15 +0000 |
commit | 4fe1a1d68234197d5303ad7323dd91636b84db14 (patch) | |
tree | e66779ac77cd3ab8d9b39f6957e7e06fa2a4ae4e /app/controllers/application_controller.rb | |
parent | bb87d842ec3559483a2c0132dbc0c216e0cb597e (diff) | |
parent | 19a0a2fedf68a256084d4dcfd70b9cb9377b9a09 (diff) |
Merge branch 'release/0.5' of github.com:sebbacon/alaveteli into release/0.5
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b7457c48e..b0351f7d1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,7 +14,10 @@ class ApplicationController < ActionController::Base # Standard headers, footers and navigation for whole site layout "default" include FastGettext::Translation # make functions like _, n_, N_ etc available) - + + # Send notification email on exceptions + include ExceptionNotification::Notifiable + # Note: a filter stops the chain if it redirects or renders something before_filter :authentication_check before_filter :set_gettext_locale @@ -119,6 +122,7 @@ class ApplicationController < ActionController::Base @status = 404 else @status = 500 + notify_about_exception exception end # Display user appropriate error message @exception_backtrace = exception.backtrace.join("\n") @@ -361,14 +365,14 @@ class ApplicationController < ActionController::Base # Store last visited pages, for contact form; but only for logged in users, as otherwise this breaks caching def set_last_request(info_request) if !session[:user_id].nil? - session[:last_request_id] = info_request.id - session[:last_body_id] = nil + cookies["last_request_id"] = info_request.id + cookies["last_body_id"] = nil end end def set_last_body(public_body) if !session[:user_id].nil? - session[:last_request_id] = nil - session[:last_body_id] = public_body.id + cookies["last_request_id"] = nil + cookies["last_body_id"] = public_body.id end end |