How can I get rails to not render escaped quotes as \"

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2010-05-17T22:22:58Z Indexed on 2010/05/17 22:30 UTC
Read the original article Hit count: 193

In my layout I have

<% @current_user.popups.each do |p| %>
  <% content_for :script do %>
    <%= "$(document).ready ( function() { $.jGrowl(\"#{p.message}\", { sticky: true }) });" %>
  <% end %>
<% end %>

And then in the script section I have

<%= yield :script %>

The problem is that this renders the escaped quotes as \&quot; and javascript doesn't like this.

How can I stop this from happening? Or is there another approach to this? I can't use single quotes because I'd like to have some html in the message. I'd appreciate any help.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about actionview