class Ability
include CanCan::Ability
def initialize(user)
@user = user || User.new
can :manage, :all
can :custom_action, User, role: 'admin'
end
end
and in view
if can? :custom_action, @user
SHOW SOMETHING
this if always show "SHOW SOMETHING", don't understood why it's happend.