I would like to test for multiple roles using rolify.
I tried this and it didn't work:
<% if current_user.has_role? [:technician, :admin] %>
Thanks for the help!
UPDATE1
I'm trying to test for :technician or :admin - this works but seems like there should be a shorter way:
if current_user.has_role? :technician or current_user.has_role? :admin
I'd recommend you test something like current_user.has_any_role? :technician, :admin, it should return you the boolean you're expecting :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With