Displaying 1 result from an estimated 1 matches for "serve_user_imag".
Did you mean:
serve_user_image
2006 Jun 27
2
Serve an image up from an action
...I am lost in the ruby/rails world.
My images are being stored in a NON application folder (I do not want
users to be able to access them directly...I want the retrieval of the
images to be controlled by an action.
I have an action in one of my controllers that looks something like
this:
def serve_user_image
@user = session[:user]
image_file = File.new(@user.image_filename, "rb")
send_data image_file, :filename => @user.image_filename, :type =>
"image/jpeg", :disposition => "inline"
end
And inside my view, something like this:
<%= imag...