assign attrs to view