Hi,
I read the Django template documentation about if in, it said:
{% if "hello" in greetings %}
If greetings is a list or set, one element of which is the string
"hello", this will appear.
{% endif %}
I am using Chicagoboss,
in my model file role.erl, I have:
-module(role, [Id, Roletype]).
-compile(export_all).
in my controller, I have:
Roles = boss_db:find(role, []),
{ok, [{roles, Roles}]};
in my view page, I have:
<ul>
{% for role in roles %}
<li>{ role.roletype }</li>
{% endfor %}
</ul>
{% if "salesmanager" in roles %}
<p>sales</p>
{% endif %}
I added salesmanager and some more roletypes into the database and they can be displayed by role.roletype, but the "if "sales" in roles" do not show sales as it supposed to be, I have replaced roles by Roles, roles.roletype, role.roletype, roletype, roletypes, not working.
I can't find a similar situation online, can anyone advise me what is wrong?
Thank you.