开发者

Render file Rails3

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. Fl开发者_JAVA技巧eximage's images work correctly, but this simple operation does not.


use:

send_file path_to_file
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜