I have a class named "Event" and am trying to get values out to pass into a javascript method. If I use,
<%= @evt.attributes.to_json %>
I get the error message "object references itself". For debugging I've tried the same call in the body tags of the template and get the same result (even when I remove all references to the javascript). When I simply use <%= @evt.to_json %> I get the following.
{attributes: {start_date: "2007-07-11", city: "Spokane", addr1: "", name: "Bobdogs Wide World of MA", latitude: "47.5", category: null, zip: "", addr2: "", url: "", contact_phone: "", country: "", hosting_studio: null, id: "1", description: null, contact_email: "bob@dog.com", longitude: "-122.6", num_days: "1", end_time: null, start_time: null, contact_name: "Bobdog", state: "WA"}}
Pretty much at a loss, I've successfully used the same code for another object but for the life of me can't figure out why it won't work with my Event object. I "Event" a bad name for an object? Reserved word? I tried renaming some of the objects attributes, but still no luck.
Any help would be greatly appreciated!!