Hey all,
I am using devise. While the data successfully updates to database, it
still reports back as an error, and the below error function is
executed:
var options = {
type: 'POST',
url: "/user",
dataType: 'json',
data: $('#dialog-form form:first').serialize(),
error: function(xhr, textStatus, errorThrown) {
alert('An error occurred! ' + errorThrown);
},
success: function(data, textStatus) {
$('body').append( data );
}
};
$.ajax( options );
I get a popup that says:
The page at http://localhost:3000 says:An error occurred! Invalid JSON:
Diet | IMRS- Sign up
- Sign in
Even when I remove the datatype here:
dataType: ‘json’
It still gives same error report.
Any idea as to whether this is devise related?
Thanks for response.