Added a render() method to get the view contents as a string