I tried to follow this answer to a similar question but in my case I'm using Rolify.
The problem I'm running into is in passthrough_controller.rb
where I can't access the Rolify .has_role?
function:
class PassthroughController < ApplicationController
def index
if current_user.has_role? :admin
redirect_to 'restaurants#index'
else
redirect_to 'http://www.google.com'
end
end
end
I have logged in using a user that I know has an admin role but it still redirects me to my else
clause.
I couldn't find anything on the Rolify github page on how to do this.
Any help would be much appreciated