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() {
...

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to