search for: jsonified

Displaying 3 results from an estimated 3 matches for "jsonified".

Did you mean: jsonifier
2008 Jan 30
0
Help with JSONified objects from ActiveRecord
Hello guys, I''m trying to return a custom JSON response to a client frontend. The object I''m trying to return is a User, with some associated Locale data. So basically I need to put the User data and his Locale in a "data" property in the JSON response. If this worked, it would be perfect: json = Hash.new json[:success] = false json[:data] = User.find(params[:id],
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
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