We've moved discussions to Discord

Checking the Account_User's role in a view?

Jason Ackerman
What is the best way to check an account_user's role in a view? For example, I want a "Preferences" link in the nav_bar to only be visible to those users who have the role of "admin" (different from the admin? flag on the User model). What is the best way to check the role of the user with regards to the active account in a view? Thanks!
Jason Ackerman
This is what I'm doing now, is there a better way?
if current_user && current_account.account_users.find_by(user: current_user).admin?
Notifications
You’re not receiving notifications from this thread.