0

I'm using the gem rails admin and pundit. I'm trying to ensure that only admin users can see the admin dashboard, but I've never used pundit before. I feel as though this must be a well documented answer but I can't seem to find what I'm looking for so hopefully some can help me here. Here is my code:

Routes:

mount RailsAdmin::Engine => '/admin', as: 'rails_admin'

I have that in my routes.rb file, But right now every user has access to it how can I wrap it in a condition checking for if the user is an admin? Like I said I have an admin boolean on user. Thanks for the help!

Bitwise
  • 8,021
  • 22
  • 70
  • 161

1 Answers1

0

You can specify request based constraints to specify the guard conditions.

lorefnon
  • 12,875
  • 6
  • 61
  • 93