I can upload pictures to a database, then display all pictures via the
filename, the files are currently stored on the filesystem…
for picture in @pictures
<%=image_tag(picture.name, :size=>"50x50", :id=>"side_image_" + indx.to_s, :style=>"border:0;", :alt=>"Images")-%> <%indx = indx + 1-%><% end %>
I changed the code to upload images into a BLOB field in the database
cause I don’t want to use the filesystem to serve up images any longer.
How can I change this rhtml code so that it goes to the BLOB field in
the database and display the pictures?
This is the code that builds the picture array,
total_pics = Picture.count
@page_num = @params[:page_num].to_i
if(@page_num < 0 or @page_num * 8 >= total_pics)
@page_num = 0
offset = @page_num * 8
if(offset + 9 <= total_pics) @next_page = @page_num + 1 end if(@page_num != 0) @prev_page = @page_num - 1; end @pictures = Picture.find :all, :limit=>8, :offset=>offset @blank_images = 8 - @pictures.length