I installed admin gem rails and it works with Devise quite easily. I want to authorize the user through a boolean, because not all users are administrators. Although I'm not sure where to place the code or how it should work. I took the code from readme and now this:
RailsAdmin.authenticate_with do
redirect_to root_path unless request.env['warden'].user.is_admin?
end
But calling the .user method appears nil, so is_admin? out of order.
Any tuning recommendations?
source
share