I have Rails 4 with Role Model for role assignment.
I can't figure out how to remove a role that was assigned to a user.
I have two roles in my profile.rb, :manager and :student.
I have a user that has been assigned both roles. I want to remove manager from that user's role assignment.
It works to try p.roles << :student, to add a role, so I tried p.roles >> :manager to try deleting it, but it didn't work.
How do you delete a role from a user?
Also, in my view, when I do:
if(current_user.has_role? :student)
I get this error:
undefined method `has_role?' for #<User:0x007fb3b39dacb0>
I don't know or understand what this message means.
Any help would be appreciated. Thanks