Forum: Ruby on Rails help with partials

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.
on 2007-06-03 02:11
(Received via mailing list)

I am trying to get a partial to update on a page, but I can't get it
to work.

Here's the relevant part of my controller:

  def update_deleted
  @listing = Listing.update(params[:id], :deleted => "1", :position =>

Here's the relevant part of my view:

    <%= render :partial=>"deleted_web_list" %>

Here's the partial _deleted_web_list.rhtml:

<div id="deleted_web_listing" class="left_column_listing">
  <%= render :partial=>"show_deleted_web_listings" %>

Here's the partial _show_deleted_web_listings.rhtml:

<% for listing in @deleted_listings %>
    <div class="box_left">
    <div class="x_image">
      <%= link_to_remote(image_tag("restore.gif", :size =>
"44x13", :border => "0" ),
  :url => { :action => 'restore_deleted' , :controller=> :admin, :id =>})
      <div class="search_result_url_to_show"><%=
h(truncate(listing.url_to_show, 22)) %></div>
      <div class="search_result_description"><%=
h(truncate(listing.description, 35)) %></div>
<% end %>

When I perform the action "update_deleted" in my controller, the
database updates properly.

When update_deleted.rjs looks like this, I see this replacement text
without refreshing my browser:

page.replace_html 'show_deleted_web_listings' , '<div>this is the
replacement text</div>'

But when I try to use my partial to replace text, it does not work.
The database updates properly, but my partial _deleted_web_list.rhtml
does not show up, completely refreshed, when I perform my action
"update_deleted" -

page.replace_html 'show_deleted_web_listings' , :partial =>

Any ideas?

Keynan P. (Guest)
on 2007-06-03 10:06

replace_html 'show_deleted_web_listings' , :partial =>

no page.
on 2007-06-06 05:38
(Received via mailing list)
Hi, thanks.  This does not work for me.  I get this error:

ctionView::TemplateError (undefined method `replace_html'  . .  .

On Jun 2, 11:06 pm, Keynan P. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.