elixir - How to render raw HTML code in Phoenix Framework? -


i'm storing raw html contenteditable tag in rethinkdb database. want display content after retrieving it.

html.eex

<div id="contenteditabletext">     <%= %{"contenttext" => contenttext} <- @contenttext.data %>       <div><%= "#{contenttext}" %></div>     <% end %> </div> 

i can sucessfully retrieve it, it's displaying raw html itself.

the phoenix_html library provides raw/1 function case. phoenix_html included default should need do:

<div id="contenteditabletext">     <%= %{"contenttext" => contenttext} <- @contenttext.data %>       <div><%= raw(contenttext) %></div>     <% end %> </div> 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -