app/controllers/application_controller.rb
def after_sign_in_path_for(resource)
    if current_user.admin?
      user_admins_path
    elsif current_user.user_group.present?
      user_group_path(current_user.user_group)
    else
      root_path
    end
  end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def after_sign_in_path_for(resource)
    if current_user.admin?
      user_admins_path
    elsif current_user.user_group.present?
      user_group_path(current_user.user_group)
    else
      root_path
    end
  end
def after_sign_in_path_for ( resource ) if current_user . admin? user_admins_path elsif current_user . user_group . present? user_group_path ( current_user . user_group ) else root_path end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .
resource