diff options
author | Rasik Pandey <rbpandey@gmail.com> | 2008-08-30 04:19:18 +0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-29 18:45:39 -0700 |
commit | 16b9a554db7e1bf3f5f224cdc5b4d27480e053ff (patch) | |
tree | 7eef718fa623a5fcebb90de534b0eba2a6eae020 /activeresource/lib/active_resource/formats/json_format.rb | |
parent | 11eb29f60ab79caf22f7ca715500e32d9a1b03a2 (diff) | |
download | rails-16b9a554db7e1bf3f5f224cdc5b4d27480e053ff.tar.gz rails-16b9a554db7e1bf3f5f224cdc5b4d27480e053ff.tar.bz2 rails-16b9a554db7e1bf3f5f224cdc5b4d27480e053ff.zip |
Format related patches to support serializing data out in the correct format with correct http request headers per http method type [#450 state:resolved]
Signed-off-by: Tarmo Tänav <tarmo@itech.ee>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activeresource/lib/active_resource/formats/json_format.rb')
-rw-r--r-- | activeresource/lib/active_resource/formats/json_format.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activeresource/lib/active_resource/formats/json_format.rb b/activeresource/lib/active_resource/formats/json_format.rb index df0d6ca372..9e269d4ded 100644 --- a/activeresource/lib/active_resource/formats/json_format.rb +++ b/activeresource/lib/active_resource/formats/json_format.rb @@ -2,22 +2,22 @@ module ActiveResource module Formats module JsonFormat extend self - + def extension "json" end - + def mime_type "application/json" end - - def encode(hash) + + def encode(hash, options={}) hash.to_json end - + def decode(json) ActiveSupport::JSON.decode(json) end end end -end
\ No newline at end of file +end |