Forum: Ruby on Rails Denying requests for Amazon Product Previews?

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.
Bd125608e711510ba0d23960a7bd5ccd?d=identicon&s=25 Ben Straub (Guest)
on 2007-01-19 16:30
(Received via mailing list)

I'm writing a toy wishlist application served by mongrel. It recognizes
URL's for Amazon items and inserts an affiliate ID, and I've enabled
the Product Previews feature (check the demo here: ) by including the following in my layout:

<script type="text/javascript"
    <img src=""
alt="" />

This works beautifully, and the previews pop up after all the JS is
loaded (~5 sec), but my log is then filled to overflowing with things
like this:

Processing PeopleController#function (property) {    var results = [];
  this.each(function (value, index) {results.push(value[property]);});
  return results;} (for at 2007-01-12 08:54:36) [GET]
  Session ID: 460f7da5266f6c1e87653c2ddf903023
  Parameters: {"action"=>"function (property) {    var results = [];
this.each(function (value, index) {results.push(value[property]);});
return results;}", "controller"=>"people"}

ActionController::UnknownAction (No action responded to function
(property) {    var results = [];  this.each(function (value, index)
{results.push(value[property]);});    return results;}):

That script include is sending LOTS of requests. At first I tried
denying these with a before_filter in my ApplicationController which
returned false if it recognized the javascript in the request, but the
browser is still making all the requests to the server on every page
load, so the browser can't do the hover-popup coolness until ~5 seconds
after the page is visibly done rendering. I thought of using routing,
but answers do not quickly reveal themselves on the intargoogle.

Any ideas? Ideally, I'd like the browser to stop sending requests for
the javascript - it doesn't happen with static pages served by apache.

-- Ben
This topic is locked and can not be replied to.