mirror of
https://github.com/actix/actix-web.git
synced 2024-12-16 05:06:33 +00:00
fix example
This commit is contained in:
parent
093d0bae40
commit
b714e1f4ce
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ struct State {
|
||||||
fn index(req: HttpRequest<State>) -> Result<HttpResponse> {
|
fn index(req: HttpRequest<State>) -> Result<HttpResponse> {
|
||||||
let s = if let Some(name) = req.query().get("name") { // <- submitted form
|
let s = if let Some(name) = req.query().get("name") { // <- submitted form
|
||||||
let mut ctx = tera::Context::new();
|
let mut ctx = tera::Context::new();
|
||||||
ctx.add("name", name);
|
ctx.add("name", &name.to_owned());
|
||||||
ctx.add("text", &"Welcome!".to_owned());
|
ctx.add("text", &"Welcome!".to_owned());
|
||||||
req.state().template.render("user.html", &ctx)
|
req.state().template.render("user.html", &ctx)
|
||||||
.map_err(|_| error::ErrorInternalServerError("Template error"))?
|
.map_err(|_| error::ErrorInternalServerError("Template error"))?
|
||||||
|
|
Loading…
Reference in a new issue