Forum: Ruby on Rails Update Ajax RJS problem link_to_function

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.
37f7b5a79147b25dab424948e9d96fc7?d=identicon&s=25 vlain (Guest)
on 2008-11-26 12:56
(Received via mailing list)
Hello to all.
I use ajax tabs (rails redux)
http://actsasflinn.com/Ajax_Tabs/index.html.
I have 2 simple tab ("All" and "Favorites"). As default "All" is
selected, when I click "Favorites" request is correct and there is the
render of rjs but I obtain the classic error:

... try { Element.update("favorites_pane", "\n \n \n ... and so on...

If I change div and I put it before the div panecontrol1 all is ok.
Code of  loadPane method, tabselect and paneselect is on Flinn blog (I
change only li element with div element).

-------------------------------------------------------
This is the view

<ul class="tabselector" id="tabcontrol1">
  <li class="tab-selected" id="all_tab">
    <%= link_to_function('All', "tabselect($('all_tab')); paneselect($
('all_pane'))") %>  </li>
  <li class="tab-unselected" id="favorites_tab">
    <%= link_to_function('Favorites', "loadPane($('favorites_pane'),
'" + url_for(:action => 'favorites') + "'),
                tabselect($('favorites_tab')); paneselect($
('favorites_pane'))") %>
  </li>
</ul>

<div class="panes" id="panecontrol1">
  <div id="all_pane" class="pane-selected"> <%= render :partial =>
'forum/forum'%> </div>
  <div id="favorites_pane" class="pane-unselected"></div>
</div>
-------------------------------------------------------
This is favorites.js.rjs

page.replace_html "favorites_pane", :partial => 'shared/xxx'
37f7b5a79147b25dab424948e9d96fc7?d=identicon&s=25 vlain (Guest)
on 2008-11-26 13:56
(Received via mailing list)
Sorry, I found the solution. Simply I was looking in the wrong place
(a little break was useful).

Update in the Ajax is the error, change with Ajax.Request in the the
method reloadPane solves the problem:

    new Ajax.Request(src,
        {asynchronous:1, evalScripts:true, onLoading:function(request)
{pane.innerHTML=waiting_pane}}
      )
This topic is locked and can not be replied to.