Displaying 20 results from an estimated 1100 matches similar to: "Getting JSON from the body of a POST"
2006 Jan 14
1
BUG: HTTP body content get parsed in PUT call
I''m developing a Rail application to accept data upload using HTTP PUT
call. Support for PUT in Rails seems to be broken in query params
parsing. I have a patch to fix the problem, but I''m not sure if it is
the "right" solution. Can some Rails developers take a quick look? I
can really use some help. :-)
Here is the evident of broken param parsing.
Processing
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 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 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?
2006 Jan 21
19
RoR - Mac OS 10.4.4 on Intel
I got a new 20 inch iMac dual core today and am busy getting it all
setup. A couple of issues though:
1. Is the Ruby 1.8.2 install by Apple still botched or has that been
fixed? I recall someone had fixed the rbconfig.rb to get it working.
Is this something I still have to do?
2. Does anyone know if Locomotive is using the uniersal binaries, or is
it targetting PPC yet? I couldn''t
2006 Feb 19
8
require ''digest/md5'' not working on Mac or Windows
I''ve tried the following line in ruby script/console
require ''digest/md5''
Both my Mac (Intel iMac) and my Windows box return "false"... Any ideas
what could be wrong? I was trying to do the RoR Recipe on page 54 of
Chad Fowler''s new (beta) book.
-Mark
--
Posted via http://www.ruby-forum.com/.
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
2006 Jan 04
7
<% if ... -%> What is this?
I seen some RoR code that went like this:
<% if ...blah, blah... -%>
.. blah, blah
<% end -%>
What are the minus signs for in the if statement? Cannot seem to find
anything about this, and searching on "-" in this context is hard to get
anything meaningfull back.
Thanks,
- Mark
--
Posted via http://www.ruby-forum.com/.
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
2017 Jun 23
1
setReplaceMethod creates 'object' in the userworkspace
Hi,
I recognized that the function 'setReplaceMethod' is creating a
character vector in the user workspace having the name (e.g. "newClass")
of the class used as value. If you can sort out a mistake by myself, I
would like you to file a bug report.
BBFN,
Jonathan
setClass("newClass", representation(value="numeric"))
setMethod(f = "initialize",
2017 Jun 23
1
setReplaceMethod creates 'object' in the userworkspace
Hi,
I recognized that the function 'setReplaceMethod' is creating a
character vector in the user workspace having the name (e.g. "newClass")
of the class used as value. If you can sort out a mistake by myself, I
would like you to file a bug report.
BBFN,
Jonathan
setClass("newClass", representation(value="numeric"))
setMethod(f = "initialize",
2003 Jun 17
1
problem clearing the "Read Only" attribute from Windows XP
I am trying to configure a share using Samba version 2.2.7a, and have
not been able to clear the "Read Only" attribute of created folders from
within XP.
In smb.conf, I have: read only = no, and am mapping the archive, system
and hidden attributes to the Linux x bits.
I have set the permissions for all users to allow changing attributes
and permissions, yet the bit always returns
2006 Jan 08
3
Getting the current Action in the Model
Is it possible to get the current Controller''s action from within the
Model? I have a situation where I want a piece of validation to run on
edits, but not on new creates.
Thanks,
- Mark
--
Posted via http://www.ruby-forum.com/.
2012 Nov 30
5
subset data frame by variable with missing value
Hello,
I have a variable in a data frame that contains NA values. I just want to
subset so that I get the obs where that variable is missing.
In SAS I would do:
data missing;
set test;
if myvalue=' ';
run;
How can I perform this simple task in R?
Thanks in advance for your help.
--
View this message in context:
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
2012 Jan 19
1
dataframe: how to select an element from a row
Hi,
I 'd like to select the Date where myvalue =1800 appears the* first time*.
For instance:
df =data.frame(date, myvalue, ...)
...
Date myvalue
2012-01-05 2500
2012-01-06 2450
*2012-01-07 1800*
2012-01-08 2200
2012-01-09 1800
I'd like to retrieve the third line.
I do
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
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