Forum: Ruby on Rails RJS error using page.replace_html

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.
Sai E. (Guest)
on 2006-12-25 12:03
(Received via mailing list)

I get an odd RJS error on both lines of the search.rjs replace_html. (I

think it's a similar error as what I get in the subforms.)

The result is two popups with the RJS error (in dev mode) and a
completely messed up output on the page, like this:

Element.update("project-tbody", "\n\n\n\n \n \n  \n  \n \n  \n  \n \n
\n \n Orgs.\n
\n \n Tasks\n

... where there should be the properly formatted table.

The Webrick log shows this as a clue:
[2006-12-22 19:04:33] ERROR bad URI

I'm sure that the error is from this line in search.rjs:
  page.replace_html scaffold_tbody_id(params), :partial => 'project',
:collection => @projects, :locals => { :hidden => false }

because switching these two lines on def search:
#    render :action => "component", :layout => false
    render :action => 'search.rjs'

- and therefore just re-rendering the whole form rather than using the
replace_html - works fine. (Though it's not very AJAXy.)

The matching section in component is:
  <tbody id="<%= scaffold_tbody_id(params) %>">
    <% if !removed_email_address@domain.invalid? %>
      <%= render :partial => 'project', :collection => @projects,
:locals => { :hidden => false } %>
    <% end %>

... so as far as I can tell the page_html call looks right.

But, it doesn't work.

So, any ideas of why it's going wrong?
This topic is locked and can not be replied to.