Forum: Ruby on Rails js request / rendering issues

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Chris O. (Guest)
on 2009-01-11 05:39
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 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 }

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.
This topic is locked and can not be replied to.