rendering JSON in Rails > 3 uses as_json

Replace the to_json methods with as_json.