I''d really like to see just 2 more functional changes to the JSON serialization/encoding before we get to Rails 2.0. First, and I think this is really crucial because without it all the efforts to output JSON from ActiveRecord objects would have been half in vain, is to allow us to do this in controllers: @authors = Author.find(:all) render :json => @authors.to_json(:only => :name) Currently you can only to_json on a _single_ AR::B instance, but not for lists of them. I''ve a patch at http://dev.rubyonrails.org/ticket/9751 that does this but needs verification and probably more input. The other change, while not as serious, is to get an unambiguous Time, Date and DateTime #to_json format, i.e. to get dates encoding to JSON like this: 2007/10/01 12:15:02 CDT instead of: 0/01/2007 12:15:02 CDT gbuesing has a patch at http://dev.rubyonrails.org/ticket/9750 that needs your help with verification and ideas on whether this different date format would work. This is the last sprint before Rails 2.0 I''m guessing so if you use JSON at all please do chip in! Thanks for listening. Cheers, Chu Yeow --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
eggie5
2007-Oct-04 03:04 UTC
Re: 2 more JSON / XML feature parity patches before Rails 2.0
I agree!!! Please!!! On Oct 3, 7:35 pm, chuyeow <chuy...@gmail.com> wrote:> I''d really like to see just 2 more functional changes to the JSON > serialization/encoding before we get to Rails 2.0. > > First, and I think this is really crucial because without it all the > efforts to output JSON from ActiveRecord objects would have been half > in vain, is to allow us to do this in controllers: > > @authors = Author.find(:all) > > render :json => @authors.to_json(:only => :name) > > Currently you can only to_json on a _single_ AR::B instance, but not > for lists of them. I''ve a patch athttp://dev.rubyonrails.org/ticket/9751 > that does this but needs verification and probably more input. > > The other change, while not as serious, is to get an unambiguous Time, > Date and DateTime #to_json format, i.e. to get dates encoding to JSON > like this: > 2007/10/01 12:15:02 CDT > instead of: > 0/01/2007 12:15:02 CDT > > gbuesing has a patch athttp://dev.rubyonrails.org/ticket/9750that > needs your help with verification and ideas on whether this different > date format would work. > > This is the last sprint before Rails 2.0 I''m guessing so if you use > JSON at all please do chip in! Thanks for listening. > > Cheers, > Chu Yeow--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
chuyeow
2007-Oct-04 03:37 UTC
Re: 2 more JSON / XML feature parity patches before Rails 2.0
Thanks for checking in http://dev.rubyonrails.org/ticket/9751 (and improving a few things too), bitsweat! On Oct 4, 10:35 am, chuyeow <chuy...@gmail.com> wrote:> I''d really like to see just 2 more functional changes to the JSON > serialization/encoding before we get to Rails 2.0. > > First, and I think this is really crucial because without it all the > efforts to output JSON from ActiveRecord objects would have been half > in vain, is to allow us to do this in controllers: > > @authors = Author.find(:all) > > render :json => @authors.to_json(:only => :name) > > Currently you can only to_json on a _single_ AR::B instance, but not > for lists of them. I''ve a patch athttp://dev.rubyonrails.org/ticket/9751 > that does this but needs verification and probably more input. > > The other change, while not as serious, is to get an unambiguous Time, > Date and DateTime #to_json format, i.e. to get dates encoding to JSON > like this: > 2007/10/01 12:15:02 CDT > instead of: > 0/01/2007 12:15:02 CDT > > gbuesing has a patch athttp://dev.rubyonrails.org/ticket/9750that > needs your help with verification and ideas on whether this different > date format would work. > > This is the last sprint before Rails 2.0 I''m guessing so if you use > JSON at all please do chip in! Thanks for listening. > > Cheers, > Chu Yeow--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
chuyeow
2007-Oct-04 18:23 UTC
Re: 2 more JSON / XML feature parity patches before Rails 2.0
I''ve added another patch based off gbuesing''s for his ticket http://dev.rubyonrails.org/ticket/9750 that requires more input and testing across different platforms. If anyone can help verify and test it or point out any flawed assumptions, it''d be very very helpful. Thanks! Cheers, Chu Yeow On Oct 4, 10:35 am, chuyeow <chuy...@gmail.com> wrote:> I''d really like to see just 2 more functional changes to the JSON > serialization/encoding before we get to Rails 2.0. > > First, and I think this is really crucial because without it all the > efforts to output JSON from ActiveRecord objects would have been half > in vain, is to allow us to do this in controllers: > > @authors = Author.find(:all) > > render :json => @authors.to_json(:only => :name) > > Currently you can only to_json on a _single_ AR::B instance, but not > for lists of them. I''ve a patch athttp://dev.rubyonrails.org/ticket/9751 > that does this but needs verification and probably more input. > > The other change, while not as serious, is to get an unambiguous Time, > Date and DateTime #to_json format, i.e. to get dates encoding to JSON > like this: > 2007/10/01 12:15:02 CDT > instead of: > 0/01/2007 12:15:02 CDT > > gbuesing has a patch athttp://dev.rubyonrails.org/ticket/9750that > needs your help with verification and ideas on whether this different > date format would work. > > This is the last sprint before Rails 2.0 I''m guessing so if you use > JSON at all please do chip in! Thanks for listening. > > Cheers, > Chu Yeow--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
eggie5
2007-Oct-04 23:32 UTC
Re: 2 more JSON / XML feature parity patches before Rails 2.0
I have a very heavy javascript app that depends on JSON responses from the server. It''s been using this excellent asp.net JSON serializer and have been running fine. I based my decision to port my server code to rails because most of my app was in the javascript with very minimal server code. Pretty much all the server did was serialize the database tables/rows into json for the client. But, to my sunrise, rails was completely not suited for this out of the box! Anyways, I''ll definetly test this out since I have a great need for this support. On Oct 4, 11:23 am, chuyeow <chuy...@gmail.com> wrote:> I''ve added another patch based off gbuesing''s for his tickethttp://dev.rubyonrails.org/ticket/9750that requires more input and > testing across different platforms. > > If anyone can help verify and test it or point out any flawed > assumptions, it''d be very very helpful. > > Thanks! > > Cheers, > Chu Yeow > > On Oct 4, 10:35 am, chuyeow <chuy...@gmail.com> wrote: > > > I''d really like to see just 2 more functional changes to the JSON > > serialization/encoding before we get to Rails 2.0. > > > First, and I think this is really crucial because without it all the > > efforts to output JSON from ActiveRecord objects would have been half > > in vain, is to allow us to do this in controllers: > > > @authors = Author.find(:all) > > > render :json => @authors.to_json(:only => :name) > > > Currently you can only to_json on a _single_ AR::B instance, but not > > for lists of them. I''ve a patch athttp://dev.rubyonrails.org/ticket/9751 > > that does this but needs verification and probably more input. > > > The other change, while not as serious, is to get an unambiguous Time, > > Date and DateTime #to_json format, i.e. to get dates encoding to JSON > > like this: > > 2007/10/01 12:15:02 CDT > > instead of: > > 0/01/2007 12:15:02 CDT > > > gbuesing has a patch athttp://dev.rubyonrails.org/ticket/9750that > > needs your help with verification and ideas on whether this different > > date format would work. > > > This is the last sprint before Rails 2.0 I''m guessing so if you use > > JSON at all please do chip in! Thanks for listening. > > > Cheers, > > Chu Yeow--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- Rails shouldn't output invalid JSON by default
- Merb-style development exception pages for Mac OS X
- [ActiveSupport] Patches needing review: re-organization of #to_query methods, preservation of XML/JSON content-type
- [PATCH] x 2 - Fix for "null pointer exception" when ask_status is called before worker is run, and docfixes
- Trac not for general use?