views:

109

answers:

1

I'm trying to render a png file in a controller in Rails3. I'm using:

render :file=>'public/images/filename.png'

However, the output seems not to be a PNG file (its contents start with "PNG" -checked it with curl- but it's not a valid file). I cannot find documentation on render :file in Rails3. Has the syntax changed for this? Even if it's a MIME type issue, I think I should be able to obtain the file with curl.

I'm using this technique to show a default image when using Fleximage's images if available. Fleximage's images work correctly, but this simple operation does not.

A: 

use:

send_file path_to_file
apeacox
It worked. Thanks!
Jose