diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-08-23 17:49:01 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-08-23 17:49:01 +0100 |
commit | 5ea4882f38bcf18016c82c1e6119c4df5237e96e (patch) | |
tree | a393c38b8b4273eee7f4a693c6f4c7a7bd55266f /app/controllers/application_controller.rb | |
parent | db8bb7fa5440855420b8f3ce24611a766e52f89e (diff) | |
parent | a311a1892507aacec5bfb2837dd10f5257dfb42c (diff) |
Merge remote-tracking branch 'origin/release/0.6.4' into wdtk
Conflicts:
app/views/request/show.rhtml
spec/models/info_request_spec.rb
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 40fa018aa..ce18e6ef5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -134,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 @@ -157,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 @@ -385,8 +392,11 @@ class ApplicationController < ActionController::Base # might fail later if the database has subsequently been reopened. return result end + def get_search_page_from_params - return (params[:page] || "1").to_i + page = (params[:page] || "1").to_i + page = 1 if page < 1 + return page end def perform_search_typeahead(query, model) |