michael m
2007-Jul-13 18:46 UTC
Getting "object references itself" error trying to execute @evt.attributes.to_json
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-B1vCYiSUUs8@public.gmane.org", 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!!
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---