# \[2.3.4\] replace\_html render rjs template instead of html

**URL:** <https://www.ruby-forum.com/t/2-3-4-replace-html-render-rjs-template-instead-of-html/179442>\
**Category:** Rails\
**Created:** [November 25, 2009, 7:45am UTC](https://www.ruby-forum.com/t/2-3-4-replace-html-render-rjs-template-instead-of-html/179442 "2009-11-25T07:45:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eivindhagen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/8baadc/32.png) [@eivindhagen](https://www.ruby-forum.com/u/eivindhagen)\
**Post date:** [November 25, 2009, 7:45am UTC](https://www.ruby-forum.com/t/2-3-4-replace-html-render-rjs-template-instead-of-html/179442/1 "2009-11-25T07:45:22Z")

</div>

I have two partials with the same base name, one for html and one for  
rjs:

\_page\_tags.html.erb  
\_page\_tags.rjs

In the .rjs template, I make this call to render the .html partial to  
replace the contents of a tag:

page.replace\_html(“page\_tags”, :partial =\> ‘page\_tags’)

The problem is - it renders the .rjs template, which causes infinite  
recursion and out-of-memory a few seconds later.

I can prevent this by calling replace\_html with the full  
filename+extension:

page.replace\_html(“page\_tags”, :partial =\> ‘page\_tags.html.erb’)

However, this same code worked fine on Rails 2.1. I am currently  
upgrading to 2.3.4 and that’s when it broke. Is this an intentional  
change in Rails? I was unable to find any information related to this  
behavior.

Any insights on this are appreciated.

-Eivind
