Ajax Error Response

When my controller renders js along with a status other than 200, the
js is not executed.

So

render :status => 400, :js => %{"alert('Error!')"}

Will not do anything, but

render :status => 200, :js => %{“alert(‘Error!’)”}

Will work just fine.

I can understand the reasoning since an error has occurred, but
shouldn’t it be an option somewhere to have it eval the
request.responseText? For now I am doing it in the :failure callback,
I was just wondering if I was missing a more elegant solution.

Thanks,
Tom

On May 6, 5:33 pm, TomRossi7 [email protected] wrote:

Is the content type getting set appropriately ?

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs