" instead of " in js code rendered by erb

Having problems rendering javascript in erb file. Thanks for suggestions.

//layout erb file (function() {

...     var widget_properties = {};    <%= content_for?(:extend_widget) ? "widget_properties = " + yield(:extend_widget) : '' %> ... })();

//view erb file <% content_for :extend_widget do %> extend = {     _init: function() {         $("input[type='checkbox']", this).live('click', function() {             ...         });     } }

<% end %>

//resulting script - notice the &quot; instead of " in code below (function() { ... widget_properties = extend = { _init: function() {     $(&quot;input[type='checkbox']&quot;, this).live('click', function() { ...

Rails 3 erb applies h() to most strings automatically. Instead of having to remember to apply h, you have to remember to mark the strings you want to be left alone as html_safe or raw. I don't know the precise syntax to use in your case, but that's where I would start looking.

Walter