ruby on rails - cancan authorization not working -
i trying let users create design can edit designs doesn't work because design.user in block nil think has way model associations setup
can :read, :all if !(user.nil?) can :create, design can :manage, design |design| user && design.user == user end can :vote, design can :vote2, design end class design < activerecord::base belongs_to :user end class user < activerecord::base has_many :designs end
Comments
Post a Comment