Use handlebars so that message is escaped in cookies example.

This commit is contained in:
Sergio Benitez 2016-11-04 15:33:58 +01:00
parent 4d189df884
commit d843e8354c
3 changed files with 6 additions and 7 deletions

View File

@ -12,4 +12,4 @@ lazy_static = "*"
[dependencies.rocket_contrib]
path = "../../contrib"
default-features = false
features = ["tera_templates"]
features = ["handlebars_templates"]

View File

@ -1,8 +1,7 @@
#![feature(plugin, custom_derive, custom_attribute)]
#![plugin(rocket_codegen)]
#[macro_use]
extern crate lazy_static;
#[macro_use] extern crate lazy_static;
extern crate rocket_contrib;
extern crate rocket;

View File

@ -7,11 +7,11 @@
</head>
<body>
<h1>Rocket Cookie Examples</h1>
{% if message is defined %}
<p>{{ message }}</p>
{% else %}
{{#if message }}
<p>{{message}}</p>
{{else}}
<p>No message yet.</p>
{% endif %}
{{/if}}
<form action="/submit" method="post" accept-charset="utf-8">
<textarea placeholder="Your message here..."