# Rjs renders string or partial but not template or action

**URL:** <https://www.ruby-forum.com/t/rjs-renders-string-or-partial-but-not-template-or-action/96986>\
**Category:** Rails\
**Created:** [July 4, 2006, 12:30am UTC](https://www.ruby-forum.com/t/rjs-renders-string-or-partial-but-not-template-or-action/96986 "2006-07-04T00:30:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [July 4, 2006, 12:30am UTC](https://www.ruby-forum.com/t/rjs-renders-string-or-partial-but-not-template-or-action/96986/1 "2006-07-04T00:30:34Z")

</div>

Hi,

I have an rjs file. I only have one controller called called front. I  
have views called “new\_title.rhtml” and “\_new\_title.rhtml”

These work

page.replace\_html ‘title’, ‘new title’  
page.replace\_html ‘title’, :partial =\> ‘new\_title’  
page.replace\_html ‘title’, {:file=\>“front/new\_title”,  
:use\_full\_path=\>true}

but these don’t

page.replace\_html ‘title’, :template =\> ‘front/new\_title’  
page.replace\_html ‘title’, :action =\> ‘new\_title’  
page.replace\_html ‘title’, :controller =\> :front, :action =\> :new\_title

This make alert boxes in my browser. “RJS error html has no  
properties” and “Element.update(‘title’, null);”

Anyone know why the last three don’t work?

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [July 20, 2006, 11:14pm UTC](https://www.ruby-forum.com/t/rjs-renders-string-or-partial-but-not-template-or-action/96986/2 "2006-07-20T23:14:00Z")

</div>

Peter,  
Did you ever get this answered? I have used RJS a ton but only  
recently had the need to render a template from RJS (usually partials  
are fine).

Anyone have the answer?

Thanks,  
Zack

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [July 23, 2006, 7:51pm UTC](https://www.ruby-forum.com/t/rjs-renders-string-or-partial-but-not-template-or-action/96986/3 "2006-07-23T19:51:25Z")

</div>

+1 for finding a good way to do this. I ended up using a partial (which  
could be called by the rjs), and then having a template with a single  
line in it calling the partial. Works fine, but has a bit of a smell
