Raimon Fs
2007-Dec-04 17:17 UTC
ActiveSupport::JSON::CircularReferenceError in InvoiceContro
Hello again, I''m trying to use a grid control from EXTjs with RoR, and I''m following some exampe I found on the web, and adapting to my test database ... I can''t see any row, the grid is only a poor line, I use other extjs in the same page, and they are ok. Trying to debuging, I found that the error, or at least one error, is when I apply the json ... Here''s the code: ----------------------- If I comment the last line: render :text=>return_data.to_json, :layout=>false I don''t get any error. Any clue of what''s wrong ? thanks, raimon return_data = Hash.new() return_data[:Total] = @invoice_pages.item_count return_data[:Movies] = @invoices.collect{|u| {:id=>u.id, :factura=>u.factura, :data=>u.data, :client=>u.tipus, :total_base=>u.total_base, :total_iva=>u.total_iva, :total=>u.total} } render :text=>return_data.to_json, :layout=>false -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2007-Dec-04 23:04 UTC
Re: ActiveSupport::JSON::CircularReferenceError in InvoiceContro
On 04 Dec 2007, at 18:17, Raimon Fs wrote:> I''m trying to use a grid control from EXTjs with RoR, and I''m > following > some exampe I found on the web, and adapting to my test database ... > > I can''t see any row, the grid is only a poor line, I use other > extjs in > the same page, and they are ok. > > Trying to debuging, I found that the error, or at least one error, is > when I apply the json ... > > Here''s the code: > ----------------------- > If I comment the last line: render :text=>return_data.to_json, > :layout=>false I don''t get any error. > > Any clue of what''s wrong ?You''ll probably have dates in your data to output as json. It doesn''t always work in Rails 1.2.x (don''t know about Edge). You could look into jsonifier, iirc this plugin fixes these kind of problems. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Raimon Fs
2007-Dec-05 08:30 UTC
Re: ActiveSupport::JSON::CircularReferenceError in InvoiceCo
Peter De Berdt wrote:> On 04 Dec 2007, at 18:17, Raimon Fs wrote: > >> >> Here''s the code: >> ----------------------- >> If I comment the last line: render :text=>return_data.to_json, >> :layout=>false I don''t get any error. >> >> Any clue of what''s wrong ? > > You''ll probably have dates in your data to output as json. It doesn''t > always work in Rails 1.2.x (don''t know about Edge). You could look > into jsonifier, iirc this plugin fixes these kind of problems. > > > Best regards > > Peter De Berdtyes, it was a date problem as you suggests ... I see that I have some more bugs in my ext grid ... thanks for your info ! regards, rai -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---