-
Hi, The earlier answer from @sunng87 ( #559 ) has been working great. Now, however, I want to put extra things into my template that are of a different types. I'm not sure (and sorry I haven't been able to find it in the examples) how to have a vector of Models and other types (here a string) in my template data. Should I be using some other collection than a BTreeMap? Should I have a nest of BTreeMaps? eg a BtreeMap that holds a BTreeMap of strings and another that holds a BTreeMap of vectors - and if so how do I refer to the data in the template? To illustrate what I have tried here is a code snippet and I've included the compile error:
Thanks Dave |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Apologies, simple when I get my brain in gear. I'm just using a Struct instead of the BTreeMap.
... let warning_name = "Test Warning".to_string();
|
Beta Was this translation helpful? Give feedback.
Apologies, simple when I get my brain in gear. I'm just using a Struct instead of the BTreeMap.
...
let warning_name = "Test Warning".to_string();
let places:Vecplace::Model = Place::find().all(&s.db).await.expect("could not find any places");