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 " instead of " in code below
(function() {
…
widget_properties = extend = {
_init: function() {
$(“input[type=‘checkbox’]”, this).live(‘click’,
function() {
…