Skip to content

Instantly share code, notes, and snippets.

@soelen
Created October 19, 2014 21:20
Show Gist options
  • Save soelen/dcac9c4dbdf4259899e7 to your computer and use it in GitHub Desktop.
Save soelen/dcac9c4dbdf4259899e7 to your computer and use it in GitHub Desktop.
<?
$this->autoRender = false;
if($this->request->is('ajax'))
{
$day = $this->request->data('day');
$data = array(
'mister' => 'x',
'affe' => $day
);
return json_encode($data);
}
data = {
'trainingLength' : 20,
'day' : 8,
'month' : 8,
'year' : 2014
}
$.ajax "#{ma.url}programs/updateTrainingVisual",
success : (data, textStatus, jqXHR) ->
console.log data
error : (jqXHR, textStatus, errorThrown) ->
console.log 'error'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment