Insert_html inserting fragment twice

Has anyone had trouble with inline RJS insert_html with the latest
version of Rails?

My problem is that insert_html inserts the html fragment twice. For
example,

render :update do |page|
    page.insert_html :top, "some_list", "<li>booyow</li>"
end

would render “

  • booyow
  • ” twice.

    Thanks.

    I found the answer.

    I had :complete => ‘eval(request.responseText)’ in my link_to_remote
    function, which was causing it to evaluate a second time. This
    behaviour is new in Rails 1.1.

    mofo mofo wrote:

    Has anyone had trouble with inline RJS insert_html with the latest
    version of Rails?

    My problem is that insert_html inserts the html fragment twice. For
    example,

    render :update do |page|
        page.insert_html :top, "some_list", "<li>booyow</li>"
    end
    

    would render “

  • booyow
  • ” twice.

    Thanks.

    hi can you explain more what you meant? basically what your
    link_to_remote looks like?

    mine is simply

    <% link_to_remote “view comments”, :url => { :controller => ‘main’,
    :action => ‘test_rjs’, Lid => @myObj%>

    my comments get inserted twice.

    THANKS@!

    mofo mofo wrote:

    I found the answer.

    I had :complete => ‘eval(request.responseText)’ in my link_to_remote
    function, which was causing it to evaluate a second time. This
    behaviour is new in Rails 1.1.

    mofo mofo wrote:

    Has anyone had trouble with inline RJS insert_html with the latest
    version of Rails?

    My problem is that insert_html inserts the html fragment twice. For
    example,

    render :update do |page|
        page.insert_html :top, "some_list", "<li>booyow</li>"
    end
    

    would render “

  • booyow
  • ” twice.

    Thanks.

    solved it, i just use form_to_remote.