This will totally work in HAML. Your initialize
method has two else
conditions - one needs to be an elsif
def initialize(user)
# Define abilities for the passed in user here. For example:
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
elsif user.editor? # Problem is here
can :edit, :all
else
can :read, :all
end
end