So, I managed to get an image blob into my MySQL database (there\'s a big hex number in the field), but I can\'t find any documentation on how to display the image in a rail
The following code should work. In your controller, create a method:
def show_image
@user = User.find(params[:id])
send_data @user.image, :type => 'image/png',:disposition => 'inline'
end
In your view:
<%= image_tag url_for(:controller => "mycontroller", :action => "show_image", :id => @user.id) %>
I would recommend using the Paperclip gem. It makes saving/viewing of images really easy.