Loading an image to instance variable of AR

Hi,

I would like to load an image (not uploading from the client) and store
this image as an instance variable of my model ?
I do that because I want to render it with
send_data(Person.defaultImage, :type => “image/jpeg”, :disposition
=>“inline”)

This is the code I did in my model, that not works ;-(, no error, but
the image is not render wth the send_data

def defaultImage
@waitingImage=[]
file=File.open("#{RAILS_ROOT}/public/images/picture.jpg", “r”)
file.each_byte do |abyte|
@waitingImage << abyte
end
return @waitingImage
end

thanks
arnaud

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs