I am having trouble setting up the redirect for my application. Users should go to their profile (users/show) and admins should go to the admin dashboard.. How do i set this up?
Currently getting the following error:
NameError in ActiveAdmin::Devise::SessionsController#create
undefined local variable or method `admin' for #<ActiveAdmin::Devise::SessionsController:0x007febe12667e8>
Application controller
def after_sign_in_path_for(resource_or_scope)
if admin
redirect_to admin_dashboard_path
else
@user
end
end
end
rails g active_admin:install
creates an AdminUser class, so I had to modify this toif resource.is_a?(AdminUser)
. – Gyn