I’m really new to rendering formats with rails and would appreciate a
little help with a json issue.
I have created a booking model in which I would like to sync with a
jquery calendar called “full calendar” through json. They have an
example json script output with the following:
[
{
“id”:1,
“title”:“Event1”,
“start”:“2009-05-10”,
},
{
“id”:2,
“title”:“Event2”,
“start”:“2009-05-20”,
“end”:“2009-05-22”,
“url”:“http://yahoo.com/”
}
]
When using the json format in rails I get:
[
{
“booking”:{
“updated_at”:“2009-05-01T15:42:44Z”,
“title”:“Booking”,
“property_id”:1,
“id”:1,
“end”:“2009-05-19”,
“start”:“2009-05-06”,
“created_at”:“2009-05-01T15:42:44Z”
}
},
{
“booking”:{
“updated_at”:“2009-05-06T09:09:48Z”,
“title”:“Booking”,
“property_id”:1,
“id”:2,
“end”:“2009-08-26”,
“start”:“2009-08-19”,
“created_at”:“2009-05-06T09:09:48Z”
}
}
]
How do I change how the json format is rendered within rails 2. I need
to get rid of “booking”, “updated_at”, property_id" and created_at".
Thanks for any help.