# Print DB value with HTML coding in it

**URL:** <https://www.ruby-forum.com/t/print-db-value-with-html-coding-in-it/128065>\
**Category:** Rails\
**Created:** [February 4, 2008, 6:43pm UTC](https://www.ruby-forum.com/t/print-db-value-with-html-coding-in-it/128065 "2008-02-04T18:43:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KTU](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@KTU](https://www.ruby-forum.com/u/KTU)\
**Post date:** [February 4, 2008, 6:43pm UTC](https://www.ruby-forum.com/t/print-db-value-with-html-coding-in-it/128065/1 "2008-02-04T18:43:50Z")

</div>

Hi

I have problem with printing database value with has text in it.

value in DB is: **workinfo**

and on html page it shows as:

\<b\>workinfo\</b\>

I use this call to print out that value:

\<%=h @imitem.grpdesc if @imitem -%\>

I would like to show that value as HTML (like it was typed) on that  
output HTML page. Now  
ruby seems to escape it.

Thank You

---

<div class="post-metadata">

**Author:** ![KTU](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@KTU](https://www.ruby-forum.com/u/KTU)\
**Post date:** [February 4, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/print-db-value-with-html-coding-in-it/128065/2 "2008-02-04T18:47:56Z")

</div>

On 4 Feb 2008, at 17:42, KTU wrote:

> I use this call to print out that value:
> 
> \<%=h @imitem.grpdesc if @imitem -%\>
> 
> I would like to show that value as HTML (like it was typed) on that  
> output HTML page. Now  
> ruby seems to escape it.

You’re escaping it (that’s what h does)

Fred

---

<div class="post-metadata">

**Author:** ![KTU](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@KTU](https://www.ruby-forum.com/u/KTU)\
**Post date:** [February 4, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/print-db-value-with-html-coding-in-it/128065/3 "2008-02-04T18:53:51Z")

</div>

yep that it was thanks again.

On Feb 4, 7:47 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
