hello i believe i have a json encoding problem, im trying to encode a map into json and then consume with fullcalendar.io
i understand this may beyond support but any help will be appreciated.
fullcalendar.io can get from a route, which should contain json and then dynamically place it i thunk the issue is my keys are quoted, i can see the resp in chrome under network and the keys are quoted how do i unquote?
heres the code
---- encoder located at /api/calendar
def render("booked.json", _params ) do
##fetchbooked jobs from db
map = %{id: 1, allDay: false, start: "2017-05-18", end: "2017-05-18", title: "Room A" }
to_string Poison.Encoder.encode(map,[])
end
the response
`{\"title\":\"Room A\",\"start\":\"2017-05-18\",\"id\":1,\"end\":\"2017-05-18\",\"allDay\":false}"
fullcalendar js thats not working
$('#calendar').fullCalendar({
events: {
url: '/api/calendar',
cache: true
}
})
but it works with
$('#calendar').fullCalendar({
events: [
{
id: '1',
title: 'Meeting',
start: '2017-05-14'
}
]
})
});