From efcc449471f688f1d992e4808609f16b28061ecf Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Tue, 28 Jan 2014 23:53:13 -0500 Subject: [PATCH] fixed issue where settings page was redirecting to nonexistent user profile page --- app/controllers/application_controller.rb | 2 +- app/controllers/users_controller.rb | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9b5009da..7c60b953 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -33,7 +33,7 @@ private def require_user unless authenticated? flash[:warning] = "You must be logged in." - store and redirect_to new_session_path + store_location and redirect_to new_user_session_path return false end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 13af08f8..a554b810 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,10 +2,7 @@ class UsersController < ApplicationController before_filter :require_user, only: [:edit, :update] - respond_to :html, :json - - autocomplete :user, :name, :full => true - + respond_to :html, :json # GET /user/edit def edit @@ -24,7 +21,7 @@ class UsersController < ApplicationController @user.save - respond_with(@user, location: user_url(@user)) do |format| + respond_with(@user, location: session[:previous_url]) do |format| end end