Open EnricoMucelli opened 1 year ago
See the example just above the following link https://tera.netlify.app/docs/#auto-escaping
@Keats thank you but nothing is working for me, can you show me a more detailed example please?
It depends on the structure of your user data and whether it's None. If it isn't, something like {{ user.email }}
(or whatever property) should work
i have this errors
just do context.insert("user", &user)
, no need to use the json! macro
nice, now i have only the context error @Keats
`the trait bound `tera::Context: Serialize` is not satisfied
the following other types implement trait `Serialize`:
&'a T
&'a UncasedStr
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 172 othersrustc[E0277](https://doc.rust-lang.org/error-index.html#E0277)
main.rs(30, 5): required by a bound introduced by this call
lib.rs(337, 46): required by a bound in `rocket_dyn_templates::Template::render`
@Keats if i follow the example i get this errors
tera
is the crate name, not your instance of Tera
@Keats and then what do i have to put insted of tera.render
Hi i have a variable with a String and i would like to pass it to a tera template but i don't know how. my main.rs :
my html.tera :