very simple question here but I don’t have the answer… 😉
I just need to browse my user db by roles. I don’t know how to match the role I’m looking for with the mask created by cancan
I tried:
@users= User.role?('manager') but of course it doesn’t work.
Do you have the answer? Thanks!!
OK, I got it. The answer was given by Ryan B. in his excellent railscasts:
Use this scope:
and simply apply it this way: