Partials and Prototype

I am having trouble sending a local variable to a partial. When I call
it from the main program it works, but when I try to do so from a rjs
file, it wont work.

In my main code I have

<% for each name in @list %>
<%= render_partial ‘/printName’, name.id %>
<% end %>

Then in the _printName.rhtml file its simply

<%= "

#{ link_to_remote("test", :url => {:action => "didItWork", :id => printName, :update => 'name_#{printName}'} }
"%>

Then in the rjs file

if !@name.nil?
page.replace_html “name_#{@name.id}”, render_partial ‘printName’,
@name.id
end

which does not work. Previously I had this working by skipping the
partial and printing the html code within the rjs file, but that
violates DRY

if !@name.nil?
page.replace_html “name_#{@name}”,
"

#{ link_to_remote("test", :url => {:action => "didItWork", :id => @name, :update => 'name_#{@name}'} }
" end

Any advice on how to send the variable in the rjs file?