I am using Octokit so as to login.
helper_method :user
def show
end
def user
client = Octokit::Client.new(access_token: session[:access_token])
begin
@user = client.user
rescue => e
redirect_to root_path
return
end
end
The root_path is in the config
root to: 'home#new'
The rescue es executed, however the redirect_to isn't working, it return to the same view as the main method. Note: I read in many post that putting return fix it, nevertheless it didn't