1

i have this in my database :

<p><u>kkkkkkkkkkkkkkkk &nbsp;&nbsp;</u><strong>kknk&nbsp;</strong></p>

When i want to display my database content, this code isn't interpreted as html. It is just displayed as text. i would like this content to be interpreted. (so will give a bold text, an underlined word etc..).

Muntasim
  • 6,689
  • 3
  • 46
  • 69
user3242743
  • 1,751
  • 5
  • 22
  • 32

2 Answers2

2

just put:

<%=content.html_safe%>
Muntasim
  • 6,689
  • 3
  • 46
  • 69
1

Here are a bit more ways:

<%= raw content %>
<%= h content %>
<%= content.html_safe %>

and a comparison:

raw vs. html_safe vs. h to unescape html

Community
  • 1
  • 1
trushkevich
  • 2,657
  • 1
  • 28
  • 37