So this is the original code I used, and it worked

send_file 'vendor/sprites/not-found.png', {:filename =>
"sprite-not-found.png", :type => "image/png", :disposition => "inline"}

Now I switched it to this (going to be adding imageMagick)

send_data File.read('vendor/sprites/not-found.png'), {:filename =>
"soldier-not-found.png", :type => "image/png", :disposition => "inline"}

But now instead of seeing my image I see the good 'ol broken image. I
assume this is because an image is binary but File.read() uses String.
How would I go about loading an image into RAM and serve it?

Also would it just be better for me to make the image, cache it, then
use send_file to it instead of send_data?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to