hi,
its about a saving procedure in my controller that i call from my view
via jquery.
i cant use the callback from jquery, cause cake is throwing some DB
errors, so my response is messed up.
my JS: calling the save method in controller
========================================================
$.post(installFolder + 'books/save', {
}, function(result){
var result = jQuery.parseJSON(result);
if(result.successful == false)
$.pnotify({ pnotify_title: 'FAILED
SAVING'});
else
window.location.href = installFolder +
'/books/view/'+id;
});
controller: if saving correct, send "successful:true" to view, other
send "false"
========================================================
..saving successful...send true
.....
else
{
$this->Book->rollback();
$result = array("successful" => false);
}
$this->renderJSON($result);
now if the saving fails i get tons of error code and at last my
{"successful":false}" and the user wont get any feedback that his
saving failed..
so how do i get rid of all the error output? or how can i send the
{"successful":false}". manually with json?
this is driving me nuts. appreciate it.
thx
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php