public static function update($id)
 {
     self::check_logged_in();
     $params = $_POST;
     $attributes = array('id' => $id, 'name' => $params['name'], 'description' => $params['description'], 'priority' => $params['priority'], 'done' => isset($_POST['done']));
     //Kint::dump($params);
     $memo = new Memo($attributes);
     $errors = $memo->errors();
     if (count($errors) > 0) {
         View::make('memo/edit.html', array('errors' => $errors, 'attributes' => $attributes));
     } else {
         $memo->update();
         Redirect::to('/memo/' . $memo->id, array('message' => 'Muistiinpanoa muokattu onnistuneesti'));
     }
 }