Ruby on Rails
Wednesday, July 8, 2015
Why do you not use
if current_user.roleid == 1
to test if the logged in user is admin or not?
Hey colin ignore my last message. I just tried by inserting 1 in between quotes like this and it worked!!
if current_user.roleid == "1".
May be it was considering 1 as Boolean value or something.
Thank you for if condition without the need of those three admin methods.
Thank you again
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/e53b68c4-4bc5-412f-bae0-898f8d92330d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment