# Odd nuance on getting erb or js files

**URL:** <https://www.ruby-forum.com/t/odd-nuance-on-getting-erb-or-js-files/153742>\
**Category:** Rails\
**Created:** [November 20, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/odd-nuance-on-getting-erb-or-js-files/153742 "2008-11-20T18:34:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [November 20, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/odd-nuance-on-getting-erb-or-js-files/153742/1 "2008-11-20T18:34:47Z")

</div>

I’ve got a partial rendered in a something.js.rjs file. This works just  
fine when I call the method on the controller using xhr(etc etc) in my  
functional tests. So from the point of view of the tests an Ajax request  
is pulling the right stuff though and the associated assert\_selects are  
finding it in the returned result. But…

When I try to get the page fragment via a button in a remote form then  
the result is ‘could not find template something.html.erb’.

My understanding of this is that the ActionController would look for  
something.js.rjs if it couldn’t find the html.erb. In this case it  
isn’t. The request coming through the remote form seems to look like a  
standard post request and it’s trying to find an html.erb to render the  
result. Wtf is going on here?

Comments please

John S.
