defined view function for book controller