cookbook for dynamic views based on model properties

Fixed changes suggested by @trek and @stefanpenner