unless I'm mistaken, doesn't the Mime types already take care of this? 

```request.format == :js && !request.xhr?```