How to eliminate replace_html alert pop-up in RJS


I’m using RJS for AJAX call. Something like:

page[“edit_single_client_div” + params[“client_id”]].replace_html
:partial => ‘client_single_display’, :locals => {:the_client =>
SmsClient.valid.find_by_id(params[:client_id]), :recipients_session_id
=> params[:recipient_session_id]}

it works fine but sometimes the DIV doesn’t exist on the page because
the user has paginated that piece of the page. the replace_html displays
Alert about that. I want to keep silent and just ignore the fact that
the DIV doesn’t exist on page anymore.

Any ideas how to do that?



how about making it conditional? check existence of that div

Thanks MaD. Could you please provide a code on how to do this in RJS?



there is a similar thread:

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