I’m trying to update a list, and having a hard time applying visual
to the latest element created. Here is what I’m doing.
Creating an “item” via an action, then rendering the RJS template
RJS template looks like this:
page.insert_html :top, ‘items’, :partial => ‘item’
page.visual_effect :highlight, @item_id, :duration => 3
Once all this is done, I check the source of the page, and an item
the @item_id doesn’t exist in the HTML yet… as it’s just being ajaxed
partial. If I refresh the page, it’s obviously there.
So, my question is… is there a clean way to create an effect on a
created element in a list ?