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

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -