Ruby on Rails
Tuesday, January 31, 2017
Thanks, that worked !
On Tuesday, January 31, 2017 at 1:49:20 AM UTC-5, Bill Felton wrote:
-- On Tuesday, January 31, 2017 at 1:49:20 AM UTC-5, Bill Felton wrote:
Is it a boolean column?We wind up setting @user = current_user, and then checkingif @user.admin#current_user.admin should work just as well if you don't need to hang on to the actual signed in user.…endOtherwise,@user.<column_name> == "admin" #(or whatever you use)cheers,BillOn Jan 30, 2017, at 4:48 PM, Joe Guerra <jgu...@jginfosys.com> 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.Thanks,Joe--
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 rubyonrails-ta...@googlegroups.com .
To post to this group, send email to rubyonra...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ .e4ec59a4-4bb5-4e0f-9490- d659d6350a47%40googlegroups. com
For more options, visit https://groups.google.com/d/optout .
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a07b6d98-5dd9-4b88-9aea-9557eff28667%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment