where ajaxJobListWrapper is a div and update_job_list renders a
partial, is there any way to REPLACE the current ajaxJobListWrapper
div content by the content returned by the update_job_list action?
The content returned by update_job_list as used above places the
returned content above the existing content. I would like to replace
it. I’ve tried all of the positions. Any ideas on an approach for
how to do this?
where ajaxJobListWrapper is a div and update_job_list renders a
partial, is there any way to REPLACE the current ajaxJobListWrapper
div content by the content returned by the update_job_list action?
Use page.replace in an RJS template rather than the :update option on
observe_field. I highly recommend Cody F.'s PDF on O’Reilly, ‘RJS
Templates’. Ten bucks well spent.
in update_job_list.rjs, but had the same problem: the content returned
from the partial job_listings appeared is added to the existing
content (instead of the select filtering the list, when clicked,
content is added).
this seems correct (it would seem that the content of the div needs to
be REPLACED in the DOM), but triggers the following RJS error:
TypeError: Element.replace is not a function
I don’t expect to have my code debugged here, but I’m completely new
to RJS and thought I might have misunderstood the advice given above.
Any advice on this error would be appreciated. I need to dig more
deeply into RJS. Thanks for everyone’s help.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.