Forum: Ruby on Rails Returning :success or :failure to remote function calls

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
34791e1d8c4def65f9b93294638a7e04?d=identicon&s=25 Joerg Diekmann (joergd)
on 2006-01-10 10:10
Hi,

When calling remote functions (AJAX), I can test for :success and
:failure. But how do I return a :success or :failure to my AJAX function
call from my action?

Thanks
Joerg
6828ffc79486cd2442714bf32286a910?d=identicon&s=25 Vivek Krishna (Guest)
on 2006-01-10 12:12
(Received via mailing list)
In your controller
render :nothing, :status=>200  # calls success
render :nothing ,:status=>500 #calls failure ,any status  other than 2XX
34791e1d8c4def65f9b93294638a7e04?d=identicon&s=25 Joerg Diekmann (joergd)
on 2006-01-10 12:14
Ah awesome - thanks.
This topic is locked and can not be replied to.