similar to: 2 more JSON / XML feature parity patches before Rails 2.0

Displaying 20 results from an estimated 5000 matches similar to: "2 more JSON / XML feature parity patches before Rails 2.0"

2007 Sep 28
2
Rails shouldn't output invalid JSON by default
Please check out this ticket (which would explain almost everything): http://dev.rubyonrails.org/ticket/8762 So basically, Rails to_json methods produces invalid JSON out of the box as it doesn''t quote all hash keys. This is valid JSON: { "id": 6589, "code": "SIN", "name": "Singapore" } This is not (Rails'' JSON encoders
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?
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)
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 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
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
2007 Mar 28
7
Rails, REST and JSON
Hi everyone, I''m writing a lightweight AJAX application using Rails on the server side as a RESTful web service provider. I need the web service to support both JSON and XML I/O. Outputting data in XML and JSON is easy (using to_xml and to_json), and it''s also easy to do XML input as Rails does it for you automatically. Is it possible to somehow have the same automatic parsing
2007 Dec 27
5
Rails 2.02 dropped JSON attribute tag ?
Hey there I was scratching my head over why my application breaks when I run on a local server but works on my remote server. It turns out that my local server is Rails 2.0.2 and my remote server is 1.2.3 and I expect the tag "attributes" to be passed with a json stream, before parsing. Unfortunately, this was dropped in 2.0.2. Is there any documentation on this? Any way to get it back?
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
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
2011 Oct 25
7
additional model attributes
Hi, i have a "place" model with 2 columns (id, name). I''m calling an external api which gives me data to create a new place object. I would like to add the address from the external place to the place object and render it as a json result, without storing it in the database. i don''t get any errors, but the address never shows up within the json output. i''ve
2011 Aug 25
7
How to safely embed JSON object in HTML document
Hi all, I''m working on a Backbone.js single page app with Rails 3.1, and in an attempt to save on HTTP requests, I want to embed initial data set in a HTML document that is sent back to the browser after successful login. I was thinking I can simply convert my ruby object to JSON, then HTML escape resulting string of JSON, and then use that as a value for JavaScript variable. Something
2013 Jan 07
4
JSON::ParserError in controller
Hi All I''m trying to build an application which requires to scrap information from a webpage. On trying to perform the action, I get an error while trying to convert the html data to JSON. Has anyone experienced this before and if so can you please tell me how to solve this problem ? Please see below for code snippet and error log. Thanks in advance Anush require
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
2010 Jun 08
8
rails, ajax, json, and script
Could someone please demonstrate the code to send both json (or xml) AND javascript (to be executed) in a single Ajax request? Is this even possible? -- 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
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
2012 Mar 26
3
render :json not sending any data back ...
[rails 3.2.2] I perform an ajax call : ... $.ajax url: " /backoffice/expenses/rate" type: "GET" dataType: "json" data: project_id: $(''#project_id'').val() code: $(this).val() success: (result) -> alert result $(''#expense_price'').val(result) in