Ruby on Rails Monday, January 30, 2017

Is it a boolean column?

We wind up setting @user = current_user, and then checking 
if @user.admin  
#current_user.admin should work just as well if you don't need to hang on to the actual signed in user.
@user.<column_name> == "admin"   #(or whatever you use)


On Jan 30, 2017, at 4:48 PM, Joe Guerra <> wrote:

I know there is a current_user method for devise, but how do you check if the user is admin?  (I've got a user flagged as admin).

I have a admin menu that I'd like to enable / disable when admin is logged in.


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment