# Js request / rendering issues

**URL:** <https://www.ruby-forum.com/t/js-request-rendering-issues/157424>\
**Category:** Rails\
**Created:** [January 11, 2009, 4:39am UTC](https://www.ruby-forum.com/t/js-request-rendering-issues/157424 "2009-01-11T04:39:03Z")\
**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:** [January 11, 2009, 4:39am UTC](https://www.ruby-forum.com/t/js-request-rendering-issues/157424/1 "2009-01-11T04:39:03Z")

</div>

Two issues:

1. Why does rails have a hard time detecting js calls? If I make a  
jquery ajax request to foo/bar it fails, but if I append a js extension  
it passes =\> foo/bar.js. It seems that ror ignores the request headers  
and only looks at the extension. Am I missing something?

2. I am adding some ajax calls for some destroy requests and noticed  
that rails always wants to render back the destroy.html.xxx template.  
Obviously on a destroy ajax call I don’t want a template rendered.

The only way to get around this is to do:

respond\_to do |r|  
r.js { render :text =\> “”, :template =\> false }  
end

Is there something that I am missing that is causing this?

I am currently using v2.1.0, although it is on the todo list to update  
the site after the current upgrades.

Thanks for the help.
