diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-02 17:11:08 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-02 17:11:08 +0200 |
commit | a0f85774c482716505b0c8c8faf59616f06245d9 (patch) | |
tree | 1b6fcb0380bde66b9bf01de2520a974ac5f665ae /app/controllers/application_controller.rb | |
parent | 6d7290f47c11c08b55d6066d5123b8b9f04cf0bc (diff) |
Redirect after sign in to previous page (unless it's a sign in/up/etc page)
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9b6367187..91904ecf0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,10 +10,18 @@ class ApplicationController < ActionController::Base rescue_from ActionController::RoutingError, with: :not_found rescue_from ActiveRecord::RecordNotFound, with: :not_found + before_filter :store_current_location, :unless => :devise_controller? + def raise_not_found raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}" end + private + + def store_current_location + store_location_for(:user, request.url) + end + protected def not_found |