Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Apr 11, 2012
1 parent 94bcc77 commit 883f8ca
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -18,6 +18,24 @@ Or install it yourself as:

## Usage

$ rails g smt_rails:install

Generator add into "application.js" requirements for mustache and "templates" folder in "app/views". Next you can create mustache templates in this folder or subfolders.

For example:

File: "app/views/templates/_test.mustache"

Hello {{msg}}!!!

In view you can render this template by this way:

<%= render "templates/test", :mustache => {msg: "Test"} %>

The same template you can render in JavaScript:

var content = SMT['templates/_test']({msg: "Test"});

## Configuration

SmtRails.configure do |config|
Expand Down

0 comments on commit 883f8ca

Please sign in to comment.