Skip to content

Instantly share code, notes, and snippets.

@hone
Created December 27, 2010 20:03
Show Gist options
  • Save hone/756489 to your computer and use it in GitHub Desktop.
Save hone/756489 to your computer and use it in GitHub Desktop.
class DisplayController < ApplicationController
def file
send_file("./flower.jpg", :disposition => "inline", :stream => true, :type => "image/jpg")
end
def data
send_data(File.read('./flower.jpg'), :disposition => "inline", :stream => true, :type => "image/jpg")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment