# How to add html element to flash \[:notice\]?

**URL:** <https://www.ruby-forum.com/t/how-to-add-html-element-to-flash-notice/171020>\
**Category:** Rails\
**Created:** [June 25, 2009, 12:05pm UTC](https://www.ruby-forum.com/t/how-to-add-html-element-to-flash-notice/171020 "2009-06-25T12:05:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [June 25, 2009, 12:05pm UTC](https://www.ruby-forum.com/t/how-to-add-html-element-to-flash-notice/171020/1 "2009-06-25T12:05:30Z")

</div>

Hello all,

I confused about how to add HTML control like anchor tag to  
flash[:notice].

This is my code

flash[:notice]= “You are all ready subscribed to#{@subscription.tariff\_plan\_id}  
service. Please Unsubscribe to create new subscription.”

and shows output as ==\>

You are all ready subscribed topremium\_yearly service.  
Please Unsubscribe  
to create new subscription.

what is the correct way of doing this.

please suggest solution

thanks,  
Vikas

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [June 25, 2009, 1:03pm UTC](https://www.ruby-forum.com/t/how-to-add-html-element-to-flash-notice/171020/2 "2009-06-25T13:03:26Z")

</div>

On Jun 25, 11:05 am, Vikas G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hello all,
> 
> I confused about how to add HTML control like anchor tag to  
> flash[:notice].

The flash is just a hash that knows to remove items automatically, so  
this question is entirely down to how you use the flash in your app.  
For example if you display the flash by doing

\<%= h flash[:notice] %\> then any html content in the flash will be  
escaped.

Fred

> 

This is my code
