Jeremy Kemper
00ee990443
JSON: split encoding and coercion
2009-06-08 13:21:30 -07:00
Jeremy Kemper
e9a7545123
Avoid uninitialized instance variable warning
2009-05-20 18:12:45 -07:00
rick
e89241c92f
load the JSON Backend lazily. If the JSON gem is already loaded, use the JSONGem backend by default.
2009-05-17 19:18:00 -07:00
Jeremy Kemper
8aaed3d456
Convert encoding before escaping
2009-04-26 16:21:57 -07:00
Jeremy Kemper
4a8d2ef0a5
Extract json string escaping
2009-04-26 15:53:59 -07:00
rick
3c4c6bd0df
* Add pluggable JSON backends with support for the JSON gem. [rick]
...
Example: ActiveSupport::JSON.backend = "JSONGem"
All internal Rails JSON encoding is now handled by ActiveSupport::JSON.encode(). Use of #to_json is not recommended, as it may clash with other libraries that overwrite it. However, you can recover Rails specific functionality
if you really want to use #to_json.
gem 'json'
ActiveSupport::JSON.backend = "JSONGem"
class ActiveRecord::Base
alias to_json rails_to_json
end
2009-04-23 00:08:40 -07:00
Jeremy Kemper
f5d720fb96
Opt in to Dependencies
2009-04-22 16:42:14 -07:00
Pratik Naik
0432d15164
Merge with docrails.
2008-07-16 13:01:23 +01:00
Pratik Naik
98dc582742
Merge docrails.
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-25 12:29:00 +01:00
Cheah Chu Yeow
8f2f88f128
Remove unused JSON methods. [ #164 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-11 19:49:47 +01:00
Rick Olson
605196c448
Add config.active_support.escape_html_entities_in_json to allow disabling of html entity escaping. [rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9238 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-08 03:45:26 +00:00
Rick Olson
1eb57a6870
Add config.active_support.use_standard_json_time_format setting so that Times and Dates export to ISO 8601 dates. [rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9203 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-01 20:25:26 +00:00
Sam Stephenson
3202fbabe6
Refactor ActiveSupport::JSON to be less obtuse. Add support for JSON decoding by way of Syck with ActiveSupport::JSON.decode(json_string). Prevent hash keys that are JavaScript reserved words from being unquoted during encoding.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6443 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-18 07:05:58 +00:00
Sam Stephenson
2516063f61
Don't quote hash keys in Hash#to_json if they're valid JavaScript identifiers.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5486 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-11 18:25:26 +00:00
David Heinemeier Hansson
218406570d
Fixed docs
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4081 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-28 03:31:01 +00:00
David Heinemeier Hansson
2e67f1adc8
RJS now does enumerations, baby! ( closes #3876 ) [Rick Olson]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3754 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-03 19:34:23 +00:00
Sam Stephenson
e567a5eb1a
Add ActiveSupport::JSON and Object#to_json for converting Ruby objects to JSON strings
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3356 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-27 03:11:03 +00:00