similar to: Rails shouldn't output invalid JSON by default

Displaying 20 results from an estimated 1000 matches similar to: "Rails shouldn't output invalid JSON by default"

2007 Oct 04
4
2 more JSON / XML feature parity patches before Rails 2.0
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 =>
2007 Dec 07
9
Merb-style development exception pages for Mac OS X
I like the merb-style exception pages where there''re links to open the files listed in the stack trace in TextMate and the source around each line a lot so I stole the idea (and the code!) and made a patch for Rails: http://dev.rubyonrails.org/ticket/10401 Here''s how it looks like in Merb: http://yehudakatz.com/wp-content/uploads/stacktrace.gif What do you guys think?
2007 Dec 07
2
[ActiveSupport] Patches needing review: re-organization of #to_query methods, preservation of XML/JSON content-type
Just a quick pointer to some ActiveSupport patches hoping for reviews: Puts Array#to_query and Object#to_query in the right places in ActiveSupport - http://dev.rubyonrails.org/ticket/10395 Preserve user-specified content type for XML and JSON rendering (currently it''s overridden and set to Mime::XML/Mimi::JSON - http://dev.rubyonrails.org/ticket/10388 Oh and a tiny patch for
2008 Jan 09
6
[PATCH] x 2 - Fix for "null pointer exception" when ask_status is called before worker is run, and docfixes
Sorry for attaching patches in emails to the mailing list, but I''m still unable to login to Devjavu for Backgroundrb (I''m able to login just fine for Merb''s Devjavu and submitted a ticket successfully). Anyway, I encountered a bug when trying to #ask_status of a worker before it''s run (or rather, before its result_hash has been set to something). Not sure why
2008 Jan 03
1
Trac not for general use?
Hi devs, I was trying to open a new ticket with a minor doc patch at the BackgroundDrb Trac (http://backgroundrb.devjavu.com/) and it seems like only admins have permission to do so. Is this intended? I read in the readme that patches should be mailed to this list, but I much prefer to use Trac since there''s already one set up. Any reason Trac is not open to registered Devjavu users?
2009 Feb 04
1
How to hack a mongrel cluster to restart in an alternating manner?
Hello, I''ve been trying (unsuccessfully) to hack my mongrel_cluster to re-ststart in an alternating manner. Specifically, this soluiton: http://blog.carlmercier.com/2007/09/07/a-better-approach-to-restarting-a-mongrel-cluster/#content Which means I an call to mongrel_rails cluster::restart to do this: mongrel_rails start 8001 mongrel_rails stop 8001 mongrel_rails start 8002
2007 Aug 07
2
"badly formed JSON" exception
I tried to implement the "Rendering JSON in actions" example from http://wiki.rubyonrails.com/rails/pages/HowtoGenerateJSON : @headers["Content-Type"] = "text/plain; charset=utf-8" data = { :foo => ''bar'', :etc => ''rez'' } render :text => data.to_json When I try to decode this in javascript with
2007 Nov 30
5
render_to_string in an after filter
I''m using render_to_string in an after_filter, which renders a partial that is sent to a web service. Here''s the code: class MyController < ApplicationController after_filter :post_to_webservice def show # show logic end def post_to_webservice stuff = render_to_string :partial => ''stuff'' webservice_post(stuff) end I get a DoubleRenderError in the
2007 Oct 24
0
2 more quick JSON-related patches
Just some quick cleanup and documentation. Remove obsolete ActiveSupport::JSON::Variable - http://dev.rubyonrails.org/ticket/9969 Add documentation for Hash#to_json and Enumerable#to_json - http://dev.rubyonrails.org/ticket/9970 Please review :) Thanks! Cheers, Chu Yeow --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2007 Oct 02
0
More JSON and XML feature parity for AR and ActiveSupport (patch review)
I''m really glad the JSON changes got in, many thanks to all involved, committers and contributors alike :). But there''s still one feature that''s missing to achieve feature parity between the JSON and XML encoding/conversion. And that is the abililty to say in your controller: @authors = Author.find(:all) render :json => @authors.to_json(:only => :name)
2008 Jan 02
3
Submitted a patch, got pluses, what now?
Hello Rails people, I submitted a patch recently to get rid of an annoying exception raised when an AR object is created - http://dev.rubyonrails.org/ticket/10556 , had some people review it, got some pluses... What am I supposed to do now? Can anybody advise or just review the patch and take care of the issue? Thanks! -- Best regards, Yuri Leikind
2008 Jan 30
0
Publish templatized action with JSON gotcha in Rails 1.2
Hey guys- to_json in Rails 1.2 produces json with unquoted keys, which is invalid. Therefore, publish_templatized_action produces invalid json for feed publishing, and you''ll get an error from Facebook. To fix this, put this line in environment.rb: ActiveSupport::JSON.unquote_hash_key_identifiers = false You don''t need to do this if you''re running Rails 2.0. Just a
2007 Oct 15
0
Some JSON doc patches
In case Rails 2.0 gets released without these bits of documentation regarding the recent JSON changes, I''d like to highlight some docfixes: http://dev.rubyonrails.org/ticket/9833 and http://dev.rubyonrails.org/ticket/9814 Could a committer could take a quick look? Thanks! Cheers, Chu Yeow --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2007 Nov 20
2
Anyone using to_xml and procs...
I''m looking for comments on http://dev.rubyonrails.org/ticket/10162 In my opinion, the current behaviour is a bug, and should be fixed. If you have a use case where passing procs to the child associations is actually useful, chime in. Jonathan del Strother --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2009 Feb 09
4
rails on ruby-1.8.7
Download page(http://rubyonrails.org/download) tells as follows "We recommend Ruby 1.8.7 for use with Rails." Which version of RoR is stable(or available) on ruby-1.8.7? I want to use rails-2.1.2. but I dont know that is appropriate. # Im going to run redMine 0.8.0 on Ubuntu 8.10. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed
2006 May 27
5
ActiveSupport JSON working?
Hi, I am trying to convert a hash to JSON using ActiveSupports built in .to_json. I am doing similar to the example below but are there certain strings that could go in place of ''bar'' or ''rez'' that will break the to_json method? I am using a very long string from rjs output in place of ''bar''. Perhaps .to_json is not ready yet? Thanks, Peter
2008 Jul 12
0
to_json in Rails 2.0.2 not generating proper json?
I am using Rails 2.0.2 and trying to use to_json to generate json. I notice several problems. 1) datetime field such as created_at mapped to "created_at": {} 2) :except does not work, @post.to_json(:except => [:created_at, :updated_at] still gives me "created_at": {}, "update_at": {} 3) problem with escaped char mapping: ''<'' mapped to
2010 Apr 05
2
Harmonizing JSON/XML serialization
The way Rails handles root nodes in JSON and XML serialization is inconsistent. This has been discussed before: https://rails.lighthouseapp.com/projects/8994/tickets/2584-232-activeresource-json-doesnt-send-parameters-with-root-node This seems mostly taken care of with ActiveModel::Base.include_root_in_json, especially if/when it ends up in ActiveResource. However, there is also the issue of how
2007 Sep 01
2
Getting JSON from the body of a POST
I have a Flash application that is sending JSON data to a Rails app. I want to be able to read the JSON from the controller. Does anyone know where I can go to figure this out? I''ve Google''d around but can only find instances of converting to JSON, not the other way. Example: Flash -> Sends JSON -> Rails Controller receives JSON and converts it to a class -- Posted
2007 Mar 24
0
overloading to_json with JSON gem installed causing error
I installed the JSON gem because I wanted the JSON parser. Before installing the JSON gem, overloading worked fine. Before I remove it, I''d like to see if anyone has an idea of what is going on. It''s the only JSON parser I''m aware of, so it would be a bummer if it didn''t work. After installing, if I overload the to_json method in the class, it gives me the