Skip to content

Commit

Permalink
(test) show data backend in render example
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Jan 7, 2016
1 parent 48db13b commit d638e50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ mod rustc_example {
pts: 12u16 } ];

data.insert("teams".to_string(), teams.to_json());
data.insert("engine".to_string(), "rustc_serialize".to_json());
data
}
}
Expand All @@ -89,7 +90,6 @@ mod serde_example {

data.insert("year".to_string(), value::to_value(&"2015"));


let teams = vec![ Team { name: "Jiangsu Sainty".to_string(),
pts: 43u16 },
Team { name: "Beijing Guoan".to_string(),
Expand All @@ -100,7 +100,9 @@ mod serde_example {
pts: 12u16 } ];

data.insert("teams".to_string(), value::to_value(&teams));
data.insert("engine".to_string(), value::to_value(&"serde_json"));
data

}
}

Expand Down
2 changes: 2 additions & 0 deletions examples/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@
</li>
{{/each~}}
</ul>

<p>Rendered by Handlebars from {{engine}} data.</p>
</body>
</html>

0 comments on commit d638e50

Please sign in to comment.