Forum: Ruby on Rails Update Ajax RJS problem link_to_function

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
vlain (Guest)
on 2008-11-26 13:56
(Received via mailing list)
Hello to all.
I use ajax tabs (rails redux)
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'))") %>

<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>
This is favorites.js.rjs

page.replace_html "favorites_pane", :partial => 'shared/xxx'
vlain (Guest)
on 2008-11-26 14: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)
This topic is locked and can not be replied to.