I am currently re-writing a web application built in python/flask that uses flashes as so:
{% with flashes = get_flashed_messages() %}
{% if flashes %}
<ul class=flashes>
{% for message in flashes %}
<li>{{ message }}
{% endfor %}
</ul>
{% endif %}
{% endwith %}
I am new to both Rust and Rocket, and I can't find any documentation on how to handle flash cookies in a tera template. Is there a way to do this, or am I approaching the problem from the wrong angle?
Currently I have refactored it into something like what is seen below, but obviously the get_flashed_messages()
part doesn't work.
{% set flashes = get_flashed_messages() %}
{% if flashes %}
<ul class=flashes>
{% for message in flashes %}
<li>{{ message }}
{% endfor %}
</ul>
{% endif %}