ruby on rails 3 - Cancan with rails_admin -


class ability   include cancan::ability    def initialize(user)        user ||= user.new            if user , user.admin?            can :access, :rails_admin            can :dashboard             if user.has_role? :superadmin                       can :manage, :all              elsif user.has_role? :admin                can :manage, [event]               end             end          end 

even if specify can :manage, :all/can :access,:rails_admin can :dashboard , remove - still directs me home page access denied error. here application controller.

class applicationcontroller < actioncontroller::base   rescue_from cancan::accessdenied |exception|     redirect_to '/', notice: 'access denied'   end   end 

what's happening here?!


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -