# Rendering partials within controller failing on js requests

**URL:** <https://www.ruby-forum.com/t/rendering-partials-within-controller-failing-on-js-requests/129246>\
**Category:** Rails\
**Created:** [February 15, 2008, 7:04pm UTC](https://www.ruby-forum.com/t/rendering-partials-within-controller-failing-on-js-requests/129246 "2008-02-15T19:04:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [February 15, 2008, 7:04pm UTC](https://www.ruby-forum.com/t/rendering-partials-within-controller-failing-on-js-requests/129246/1 "2008-02-15T19:04:24Z")

</div>

I am wondering if this is just me or…?

I have a partial contacts/\_contact\_details.html.erb that works fine when  
rendering for a html request. When I make a js request and have the  
render :partial within the controller code it fails and tells me it was  
unable to find the file.

Here is the controller code:  
def show  
@contact = Contact.find(params[:id])  
respond\_to do |format|  
format.html  
format.js { render :partial =\> “contacts/contact\_details”, :object  
=\> @contact }  
end  
end

There is a post to the rails trac regarding this where the solution is  
said that partials should have a extension of .rhtml rather than  
html.erb

The post can be found here [http://dev.rubyonrails.org/ticket/10113](http://dev.rubyonrails.org/ticket/10113)

Is this correct or rather is this they way it is supposed to be? In all  
the 2.x docs I have seen partials have the html.erb extention.

If I change the partial file to \_contact\_details.rhtml it works as it  
should for both js and html requests.

Thanks
