i have a page (assign role to user) in which i can add or remove a
i have a people model that is tied to the user model with has one
role , changing the role changes the person type
thus, if you remove a role you can assign one of the 5 roles (admin,
manager, instructor, staff, member)
here’s where i want to make sure that the user( typically an Admin)
assign any role for the selected user and wont leave this user without
if an Admin forget to assign a role the person (user / member or
whatever) become a ghost.
how can i make sure the user assign a role BEFORE they can navigate
away from the page.
i can easily check if user.roles.empty? then flash error and render /
but i tried after_filter on the controller which doesnt seem to be