Search code examples
ruby-on-railsnotice

rails -- Add div (popup) to flash[:notice]


I have a flash[:notice] = "Thanks for signing up!" I would like to add a link that activates this modal popup window I have with javascript.

The code for the popup is

<div>
<a rel="group" class="group" title="Title 1" href="/images/screencap1.jpg" >Find out how to use us</a>
<div style="display: none" >
<a rel="group" class="group" title="Title 2" href="/images/screencap2.jpg" >Thanks for joining! Let's get the ball rolling and explain how our service works works... </a>
</div>

How can I insert the above div into the flash[:notice]?

I tried just adding in between the " " but the double qoutation marks are messing the code up.


Solution

  • Instead of using double-quotes, use single quotes to make it a literal.

    That is, put the entire div in single quotes (while maintaining the double quotes in the div).