Hi guys!

I've two problems with my simple application.

I've read the documents twice, but had no luck to using boss_csrf_filter 
and passing variables to templates.

First I've done the configuration for using CSRF filter in *boss.config* 
file as the following :

{controller_filter_config, [boss_csrf_filter]},  

    {session_adapter, mock},
    {session_key, "_myapp_session"},
    {session_exp_time, 525600},
    {session_cookie_http_only, false},
    {session_cookie_secure, false},
    {session_domain, ".myappdomain.com"},


Then, I've add to variable in template (which is under 
*src/view/world/hello.html*)

<div class="row">
<div class="12u">
<textarea name="message" id="message" placeholder="placeholder" 
required></textarea>
 *{{ csrf_token }}*
 </div>
 </div>


Everthing seems fine, but no any hidden input element appearing. Should I 
check/configure anything else?

The second problem is with my app is passing variables to templates. My is 
controller something like the following code :

-module(myapp_world_controller, [Req]).
-compile(export_all).

hello('GET', []) ->
    {ok, [{world}]}.

postcontact('POST', []) ->

*                                   {redirect, "/",[{contactformsend, 
"ok"}]}.*

The code is redirecting without any value. So, the following code is not 
working (the same template file with I've mentioned above) :

{% if contactformsend %}

<script>

    alert("Hi there is!");

</script>

{% endif %}

What I am doing wrong? How can I fix the problems?

Cheers,

Ibrahim.

-- 
You received this message because you are subscribed to the Google Groups 
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/chicagoboss/e0dd8635-35e3-40ba-b736-bfd893607c2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to