From: Horacio Sanson Date: 2006-10-02T22:21:21+09:00 Subject: Re: Embed Images in eruby Cool.... I took me 3 mins to get what I wanted.... Here is the code I used: <% require 'base64' require 'RMagick' require 'cgi' include Magick img = Image.read('test.jpg').first def build_url(data) data = Base64.encode64(data).delete("\n") return "data:image/jpeg;base64,#{CGI.escape(data)}" end %>
This displays the image in the page with no problems.... ~ 月曜日 02 10月 2006 20:33、Martin Coxall さんは書きました: > > See http://redhanded.hobix.com/inspect/sparklinesForMinimalists.html > > I don't know what "Bumsparks" are, but they sound frightfully exciting. > > Martin