error while using cancan in ruby: "uninitialized constant CanCan::Rule::Mongoid"
- by Ran
here is my controller:
class AdminController < ApplicationController
before_filter :require_user
authorize_resource :class => false
def index
end
def users_list
end
end
here is my Ability class:
class Ability
include CanCan::Ability
def initialize(user)
if user.admin?
can :manage, :all
else
can :read, :all
end
end
end
when trying to access "/admin/users_list" (with an admin user or without) i get the following error:
uninitialized constant CanCan::Rule::Mongoid
any thoughts?