tracking - Returning a 1x1 .gif as a response in Rails -


I am creating rail applications that perform conversion tracking on external sites, and I get users to view their conversion pages (such as AdWords) I want to paste an image tag in, and whenever that image is requested, a conversion is registered in my app

  Do not reply. Format | If @ conversion.save flash [: notice] = 'The conversion was created successfully.' Format.html {redirect_to (@conversion)} format.xml {Render: xml = & gt; @ Conversion ,: position = & gt; : Created: Location = & gt; @ Conversion} format.js {render: json = & gt; @ Conversion ,: position = & gt; : Created} format.gif {Head: Status = & gt; : OK} and format.html {Render: Action => "New"} format.xml {Render: xml = & gt; @conversion Errors,: Status = & gt; : Unprocessable_entity} End End  

In this way, the browser gets a non-existent .gif image. Is there a better way to do this?

Simple Options:

format.gif {redirect_to '/ images / 1x1. GIF '}

I think really / old browsers (IE5, what can Netscape be?) This can not work, so if you need to support them, then the old school The solution was actually loading in binary data, with the right material type of GIF and spit it back in the browser directly.


Comments