# To\_json in Rails 2.0.2 not generating proper json?

**URL:** <https://www.ruby-forum.com/t/to-json-in-rails-2-0-2-not-generating-proper-json/142891>\
**Category:** Rails\
**Created:** [July 12, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/to-json-in-rails-2-0-2-not-generating-proper-json/142891 "2008-07-12T20:40:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![victor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@victor](https://www.ruby-forum.com/u/victor)\
**Post date:** [July 12, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/to-json-in-rails-2-0-2-not-generating-proper-json/142891/1 "2008-07-12T20:40:36Z")

</div>

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 ‘\074’ instead of  
‘\u003C’

Is there problem with my installation? Is there a module I should turn  
on?  
Do I need jsonifier plugin?

Help please!  
victor
