Forum: Ruby on Rails for_remote_tag to update diffrent <div> depending on call re

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.
olivier Hericord (Guest)
on 2005-12-21 23:38
(Received via mailing list)
hi,

is there a way to use form_remote_tag to update one div or an other
depending on the call result...???

perhaps with evaluate_remote_response but can't get it to work.


help


thanks

olivier
Mark Reginald J. (Guest)
on 2005-12-22 00:17
(Received via mailing list)
olivier Hericord wrote:

> is there a way to use form_remote_tag to update one div or an other
> depending on the call result...???
>
> perhaps with evaluate_remote_response but can't get it to work.

Yes, either use evaluate_remote_response, or the full form
of the :update option to form_remote_tag, returning the
appropriate response code from the controller.

:update => { :success => 'div_ok', :failure => 'div_error' }

render :text => 'Completed Sucessfully'

render :text => 'Processing error', :status => 500

--
We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.