Forum: Ruby on Rails Ajax Error Response

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5f3d52658aafcf0aabe76a5147e8909f?d=identicon&s=25 TomRossi7 (Guest)
on 2009-05-06 18:35
(Received via mailing list)
When my controller renders js along with a status other than 200, the
js is not executed.


    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.

81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-05-06 19:16
(Received via mailing list)
On May 6, 5:33 pm, TomRossi7 <> wrote:
Is the content type getting set appropriately ?

This topic is locked and can not be replied to.