# Help with partials

**URL:** <https://www.ruby-forum.com/t/help-with-partials/105799>\
**Category:** Rails\
**Created:** [June 3, 2007, 12:11am UTC](https://www.ruby-forum.com/t/help-with-partials/105799 "2007-06-03T00:11:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 3, 2007, 12:11am UTC](https://www.ruby-forum.com/t/help-with-partials/105799/1 "2007-06-03T00:11:49Z")

</div>

Hi,

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 =\>  
“0”)  
end

Here’s the relevant part of my view:

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

```

Here’s the partial \_deleted\_web\_list.rhtml:

 \<%= render :partial=\>"show\_deleted\_web\_listings" %\>

Here’s the partial \_show\_deleted\_web\_listings.rhtml:

\<% for listing in @deleted\_listings %\>

  

  
\<%= link\_to\_remote(image\_tag(“restore.gif”, :size =\>  
“44x13”, :border =\> “0” ),  
:url =\> { :action =\> ‘restore\_deleted’ , :controller=\> :admin, :id =\>  
listing.id})  
%\>  

  

\<%=  
h(truncate(listing.url\_to\_show, 22)) %\>
  

\<%=  
h(truncate(listing.description, 35)) %\>
  

  
\<% 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’ , ‘

this is the  
replacement text
’

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 =\>  
‘deleted\_web\_list’

Any ideas?

Charlie

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 3, 2007, 8:06am UTC](https://www.ruby-forum.com/t/help-with-partials/105799/2 "2007-06-03T08:06:34Z")

</div>

just

replace\_html ‘show\_deleted\_web\_listings’ , :partial =\>  
‘deleted\_web\_list’

no page.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 6, 2007, 3:38am UTC](https://www.ruby-forum.com/t/help-with-partials/105799/3 "2007-06-06T03:38:45Z")

</div>

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](mailto:removed_email_address@domain.invalid)
