# Renamed partial won't render?

**URL:** <https://www.ruby-forum.com/t/renamed-partial-wont-render/59180>\
**Category:** Rails\
**Created:** [April 30, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/renamed-partial-wont-render/59180 "2006-04-30T17:19:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dlg](https://www.ruby-forum.com/u/dlg)\
**Post date:** [April 30, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/renamed-partial-wont-render/59180/1 "2006-04-30T17:19:51Z")

</div>

hi all

this works

\<%= render :partial =\> “admin/works/work”, :collection =\>  
@artist.works %\>

but this doesn’t

\<%= render :partial =\> “admin/works/worklist”, :collection =\>  
@artist.works %\>

even though the partial \_work.rhtml and \_worklist.rhtml are identical.

worklist.rhtml throws

undefined local variable or method `work’  
Extracted source (around line #2):

```
1: <tr>
2: <td><%= link_to work.short_title, :action => 'edit', :id => 

```

work %\>

any ideas why?

TIA DLG

---

<div class="post-metadata">

**Author:** ![dlg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dlg](https://www.ruby-forum.com/u/dlg)\
**Post date:** [April 30, 2006, 5:48pm UTC](https://www.ruby-forum.com/t/renamed-partial-wont-render/59180/2 "2006-04-30T17:48:59Z")

</div>

no worries, i figured it out

but i’m still struggling with [Can someone help DRY a noob? thanks - Rails - Ruby-Forum](http://www.ruby-forum.com/topic/63930) if  
anyone’s feeling super-generous.

cheers

dlg

---

<div class="post-metadata">

**Author:** ![dlg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dlg](https://www.ruby-forum.com/u/dlg)\
**Post date:** [April 30, 2006, 7:51pm UTC](https://www.ruby-forum.com/t/renamed-partial-wont-render/59180/3 "2006-04-30T19:51:17Z")

</div>

Partials generate parameter objects based on their names - you need:

```
1: <tr>
2: <td><%= link_to worklist.short_title, :action => 'edit', :id =>

```

worklist %\>

Damian leGassick wrote:

> hi all
> 
> this works
> 
> \<%= render :partial =\> “admin/works/work”, :collection =\>  
> @artist.works %\>
> 
> but this doesn’t
> 
> \<%= render :partial =\> “admin/works/worklist”, :collection =\>  
> @artist.works %\>
> 
> even though the partial \_work.rhtml and \_worklist.rhtml are identical.
> 
> worklist.rhtml throws
> 
> undefined local variable or method `work’  
> Extracted source (around line #2):
> 
> ```
> 1: <tr>
> 2: <td><%= link_to work.short_title, :action => 'edit', :id => 
> 
> ```
> 
> work %\>
> 
> any ideas why?
> 
> TIA DLG

---

<div class="post-metadata">

**Author:** ![dlg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dlg](https://www.ruby-forum.com/u/dlg)\
**Post date:** [April 30, 2006, 9:14pm UTC](https://www.ruby-forum.com/t/renamed-partial-wont-render/59180/4 "2006-04-30T21:14:54Z")

</div>

thanks Mick

---

<div class="post-metadata">

**Author:** ![dlg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dlg](https://www.ruby-forum.com/u/dlg)\
**Post date:** [May 3, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/renamed-partial-wont-render/59180/5 "2006-05-03T18:56:28Z")

</div>

On 4/30/06, Damian leGassick [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> @artist.works %\>  
> 2: \<%= link\_to work.short\_title, :action =\> ‘edit’, :id =\>  
> work %\>
> 
> any ideas why?
> 
> TIA DLG

The local variable in the partial is named after the partial. Change it  
to:

\<%= link\_to worklist.short\_title, :action =\> ‘edit’, :id =\> worklist %\>

jt
