Skip to content

Commit

Permalink
add a note about using hogan.js and handlebars.js with poirot
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Nightingale authored and Oliver Nightingale committed Jan 6, 2012
1 parent b273411 commit 0c09589
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type will be set as `text/mustache` and the id will be `post-list-template`.

### Javascript Helper

Poirot also adds a javascript helper for using mustache templates from the browser. In Rails 3.1 this will be automatically added to the asset pipeline.
Poirot also adds a javascript helper for using mustache templates from the browser. In Rails 3.1 this will be automatically added to the asset pipeline, you just need to add `//= require poirot` in your application.js file.

If you are using rails 3 then you can run the `rails g poirot:install` to install the javascripts in your application.

Expand All @@ -62,6 +62,14 @@ This will return the contents of the `post_list` template wrapped in a jQuery ob

poirot.postList({foo: "bar"})

#### Using Handlebars.js

It is possible to use handlebars instead of mustache when rendering templates client side. To do this you need to first include the handlebars.js source. The instead of including `//= require poirot` in the asset pipeline you should include `//= require poirot-handlebars`

#### Using Hogan.js

It is also possible to use hogan.js instead of mustache when rendering templates client side. To do this you need to first include the hogan.js source. The instead of including `//= require poirot` in the asset pipeline you should include `//= require poirot-hogan`

## Dependencies

* Rails >3.0.0
Expand Down

0 comments on commit 0c09589

Please sign in to comment.