# Returning :success or :failure to remote function calls

**URL:** <https://www.ruby-forum.com/t/returning-success-or-failure-to-remote-function-calls/52036>\
**Category:** Rails\
**Created:** [January 10, 2006, 10:10am UTC](https://www.ruby-forum.com/t/returning-success-or-failure-to-remote-function-calls/52036 "2006-01-10T10:10:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [January 10, 2006, 10:10am UTC](https://www.ruby-forum.com/t/returning-success-or-failure-to-remote-function-calls/52036/1 "2006-01-10T10:10:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [January 10, 2006, 12:12pm UTC](https://www.ruby-forum.com/t/returning-success-or-failure-to-remote-function-calls/52036/2 "2006-01-10T12:12:44Z")

</div>

In your controller  
render :nothing, :status=\>200 # calls success  
render :nothing ,:status=\>500 #calls failure ,any status other than 2XX

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [January 10, 2006, 12:14pm UTC](https://www.ruby-forum.com/t/returning-success-or-failure-to-remote-function-calls/52036/3 "2006-01-10T12:14:34Z")

</div>

Ah awesome - thanks.
