cremalab/cremalab.com — pull request #58 by albatrocity (2013-12-06 20:18:46+00:00)
Title: Work Templates #57

@roblafeve I wasn't able to get the base directory in `app/views`, but it's not that much of a stretch to create Work template files. Do the following to create a custom template for a Work:

* Check "Templated?" in the Work form from the admin
* Enter a template file name for the admin. This will be the name of the hamstache and css files.
* create a Haml template file in `app/assets/javascripts/templates/#{template_file_name}.hamstache` - _note the .hamstache extension_
* create a stylesheet in `app/assets/stylesheets/works/#{template_file_name}.css.scss`

The template and stylesheet will be pulled in dynamically with [require](http://requirejs.org). The template will be injected into a `.showcase` div within a div with an ID of the template_file_name.

For example, if you set Live Blue's template_file_name to `live_blue`, you'd create `live_blue.hamstache` and `live_blue.css.scss`. In your CSS, you'd scope the styles with

```scss
.work#live_blue {
.showcase {
// etc.
}
}
```