I try to insert anti forgery token using ring.util.anti-forgery into html form:
(html/defsnippet post-edit-form "templates/blog.html" [:.post-edit]
[]
[:form] (html/after (html/html-content (anti-forgery-field))))
Get exception:
java.lang.IllegalArgumentException
Don't know how to create ISeq from: net.cgrand.enlive_html$html_content$fn__5571
RT.java:505 clojure.lang.RT.seqFrom
RT.java:486 clojure.lang.RT.seq
core.clj:133 clojure.core/seq
enlive_html.clj:227 net.cgrand.enlive-html/flatten-nodes-coll[fn]
enlive_html.clj:232 net.cgrand.enlive-html/flatten-nodes-coll[fn]
LazySeq.java:40 clojure.lang.LazySeq.sval
...
Also tried this:
(html/defsnippet post-edit-form "templates/blog.html" [:.post-edit]
[]
[:form] (html/after (html/html [:input {:id "__anti-forgery-token"
:name "__anti-forgery-token"
:type "hidden"
:value *anti-forgery-token*}])))
does not work :(
(anti-forgery-field) produces just html string with one 'input'. But i cant insert it into form.