similar to: Nested serialization with to_json and to_xml with array and hash element

Displaying 20 results from an estimated 200 matches similar to: "Nested serialization with to_json and to_xml with array and hash element"

2007 Dec 11
0
help for hash.to_json
hi , all under rails 2.0 aotianlong@aotianlong:~/workspace/killer$ ruby script/console Loading development environment (Rails 2.0.1) >> {:user=>"aotianlong"}.to_json => "{\"user\": \"aotianlong\"}" >> user = User.find :first => #<User id: 1, uname: "aotianlong"> >> user.to_json =>
2003 Mar 24
2
Box Plot Question
I would like to create 15 box plots from two sets of data. Set1 - containts PayGrade, Min_Salary, Max_Salary data for 15 pay grades Set2 - contains PayGrade, Actual_Min, Actual_Max, and Actual_Mean for the 15 pay grades I would like 15 box plots (one for each paygrade) whose whiskers were the Min_Salary and Max_Salary data and whose ''box'' was Actual_Min, Actual_Mean,
2011 Apr 17
0
newbie: to_json only/except + association confusion
hi, i want to return to_json with ''only'' and also filtered.so i tried various ways, but none of them are really good: A)#OK , but filter missing format.json { render :json => @project.to_json(:only => [:title ], :include=> { :tasks => {:only=>[:id,:title] } } ) } B)#Not OK > filter does not work, format.json { render :json => @project.to_json(:only
2007 Oct 23
2
to_json inconsistency?
Hello, ActiveSupport::JSON::Variable.to_json is the only to_json without an "options" parameter. Is this intended? For example, this code in a .rjs page[@user.dom_id].visual_effect :drop_out, :afterFinish => ActiveSupport::JSON::Variable.new("foo") fails with ActionView::TemplateError: wrong number of arguments (1 for 0) On line #7 of
2013 Jan 07
0
Simplified to_json method API
Sometimes to_json options feels abusing to me: user.to_json(:only => [:id, :name], :methods => [:something]) I would prefer an API like this instead: user.to_json(:id, :name, :something) What do you think about adding a use case like this to to_json? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this
2009 Aug 07
0
How to specify ActiveRecord's to_json encoding
Question: Hi, our company is using Ruby 1.8.6 with Rails 2.2.2. Does anyone know we can explicitly specify what encoding to use when calling to_json() or to_xml() methods? Problem: We have some multibyte characters in our database. For example we have a table with a name column that has this French accented e: Café Records. When we serialize this object using ActiveRecord''s to_xml()
2013 Jan 07
0
Simplified to_json usage
Sometimes default json options feels abusing to me: person.to_json(:only => [:id, :name], :methods => [:something]) I would like to be able to call something like this for AR objects person.to_json(:id, :name, :something) What do you think about extending to_json API with this use case? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2010 Jul 14
3
`stack level too deep` when overwriting `to_json`
I''m using [acts_as_commentable_with_threading](http://github.com/elight/acts_as_commentable_with_threading/), and it worked fine until I tried to overwrite the to_json function to include more details about the associated user. Here''s part of the comment class (which was originally defined in the plugin, but I moved it to the models folder, a move which seems not to affect the
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
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 Feb 20
1
Advanced use of to_xml and to_json
Hello, I''m working on a Rails app which has a REST API. I manage two formats JSON and XML. Very often to simplify the use if the API, I''m making includes. But when you add params to to_json and to_xml like :only, :except, it''s not only applied on the root object but on all the objects included. Do you know libs or methods to answer to these different problems: * Tell
2007 Oct 01
0
Patch review requested: #9750 Unambiguous Time, Date and DateTime #to_json format
This patch changes the date format for Time, Date and DateTime #to_json from the ambiguous 10/01/2007 ...to the unambiguous 2007/10/01 http://dev.rubyonrails.org/ticket/9750 --~--~---------~--~----~------------~-------~--~----~ 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
2009 Feb 23
2
to_json problem (Rails2.2.2)
Hi all, i got a record from my project server side database, like this : @user = User.find 1 then i cover @user to json format: @user.to_json the result : "created_at": "2009-01-28T12:29:32Z" what''s the T and Z of created_at field ? but i change Rails 2.2.2 to Rails1.1.6, I got : "created_at":
2012 Jan 27
2
to_json performance
Originally posted on github, reported to the right place. I would like to open a discussion about how `to_json` and `as_json` operates in Rails from a performance standpoint. I''m using Rails 3.2 but this issue applies to almost all versions of Rails. Our use case presents the challenge in sending out potentially large JSON (or XML, but we''ll focus on JSON rendering here)
2020 Sep 30
2
Logitech C922 webcam
On 09/29/2020 02:11 PM, Bruce Ferrell wrote: > Try > > lsusb -v > > and > > sudo dmesg > > ... Be aware, systemd deals with udev and it may be malfunctioning > > > On 9/29/2020 10:30 AM, H wrote: >> Just installed the above USB webcam but it is not recognized by dmesg | grep usb, nor does Zoom recognize it. I was under the understanding it should not
2020 Sep 30
4
Logitech C922 webcam
On 09/29/2020 09:09 PM, John Pierce wrote: > do other USB 3 (XHCI) devices work on this system ? > > On Tue, Sep 29, 2020 at 5:27 PM H <agents at meddatainc.com> wrote: > >> On 09/29/2020 02:11 PM, Bruce Ferrell wrote: >>> Try >>> >>> lsusb -v >>> >>> and >>> >>> sudo dmesg >>> >>> ... Be
2020 Sep 30
2
Logitech C922 webcam
On 09/29/2020 10:01 PM, Bruce Ferrell wrote: > On 9/29/20 6:50 PM, H wrote: >> On 09/29/2020 09:09 PM, John Pierce wrote: >>> do other USB 3 (XHCI) devices work on this system ? >>> >>> On Tue, Sep 29, 2020 at 5:27 PM H <agents at meddatainc.com> wrote: >>> >>>> On 09/29/2020 02:11 PM, Bruce Ferrell wrote: >>>>> Try
2015 Apr 14
0
Access Problem after update to CentOS 7.1
> > > > Thanks as always for what you and the rest of the CentOS team do, just > > appreciation and admiration for all you guys (and gals?) do for the > > community. > > Rob > > To be perfectly honest, I am not thrilled with the movement either from > the enterprise stability point of view .. BUT .. with respect to desktop > and software development it
2020 Sep 30
0
Logitech C922 webcam
do other USB 3 (XHCI) devices work on this system ? On Tue, Sep 29, 2020 at 5:27 PM H <agents at meddatainc.com> wrote: > On 09/29/2020 02:11 PM, Bruce Ferrell wrote: > > Try > > > > lsusb -v > > > > and > > > > sudo dmesg > > > > ... Be aware, systemd deals with udev and it may be malfunctioning > > > > > > On
2020 Sep 30
0
Logitech C922 webcam
try the camera in a USB 2 port, it should work just fine at usb 2 speeds. most systems, the USB 3 ports hve a 'blue' tongue, while the 2 ports are black or another color. On Tue, Sep 29, 2020 at 6:50 PM H <agents at meddatainc.com> wrote: > On 09/29/2020 09:09 PM, John Pierce wrote: > > do other USB 3 (XHCI) devices work on this system ? > > > > On Tue, Sep