The following attempt_login method attempt_login called using Ajax after the login form is attempt_login .
class AccessController < ApplicationController [...] def attempt_login authorized_user = User.authenticate(params[:username], params[:password]) if authorized_user session[:user_id] = authorized_user.id session[:username] = authorized_user.username flash[:notice] = "Hello #{authorized_user.name}." redirect_to(:controller => 'jobs', :action => 'index') else [...] end end end
The problem is that redirect_to not working.
How would you solve this?
redirect ajax ruby-on-rails ruby-on-rails-3
Misha Moroshko Mar 28 2018-11-11T00: 00Z
source share