which is a better approach? a custom status code or render a text for ajax
render :text => "pusher"
or
render :nothing => true , :status => 900
for
$.ajax({
success : function(d , s , r){
if (d == "pusher"){
}
}
});
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to indicate success then you must return a 2XX status code or you’re not speaking HTTP. If you’re not return a valid status code then you can’t expect the clients do anything useful with your response.
So you have to return one of the 2XX status codes so you’re left with:
as your only viable solution.