# SQLite - show html from entry

**URL:** <https://www.ruby-forum.com/t/sqlite-show-html-from-entry/190352>\
**Category:** Rails\
**Created:** [June 18, 2010, 10:10am UTC](https://www.ruby-forum.com/t/sqlite-show-html-from-entry/190352 "2010-06-18T10:10:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric2323223](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eric2323223](https://www.ruby-forum.com/u/eric2323223)\
**Post date:** [June 18, 2010, 10:10am UTC](https://www.ruby-forum.com/t/sqlite-show-html-from-entry/190352/1 "2010-06-18T10:10:21Z")

</div>

Hi,

I have an entry in my database that has line breaks.  
I want those line breaks to actually appear as line breaks when the  
entry is displayed.

So, I did something like:

\<%= string\_var.sub("\n","  
"🙂 %\>

It partially works. It actually replaces the \< with &lt and the \>  
symbol with &gt.  
Is there a work around this?

Thank you,  
Eric

---

<div class="post-metadata">

**Author:** ![eric2323223](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7c8e57/32.png) [@eric2323223](https://www.ruby-forum.com/u/eric2323223)\
**Post date:** [June 18, 2010, 4:58pm UTC](https://www.ruby-forum.com/t/sqlite-show-html-from-entry/190352/2 "2010-06-18T16:58:59Z")

</div>

What version of Rails are you running?

Rails 3 changed the default behavior of printing raw html and the use of  
the  
“h” method.

More information can be found here:  
[http://asciicasts.com/episodes/204-xss-protection-in-rails-3](http://asciicasts.com/episodes/204-xss-protection-in-rails-3)

–  
Fernando B.
