DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Display Images In Separate Div On Mouseover Of List Entry
Exerpt of prog to handle images from 35mm film. Main admin page displays a table of films. On mouseover of each row thumbnails of the pictures in that film are displayed in a separate div.
Exerpt of list.rhtml
<tr id="tablerow<%= roll.id %> " onMouseover="<%= remote_function(:update => "preview", :url => { :action => :preview , :id => roll.id})%>;">
Exerpt of controller.rb
def preview
@pictures = Picture.find(:all, :conditions => ["roll_id = #{params[:id]} "])
render(:partial => "preview")
end
_preview.rhtml
<% for picture in @pictures%> <img src= <%= picture.thumb_url %> alt= <%= picture.thumb_url %> height=60 > <% end %>






Comments
Snippets Manager replied on Thu, 2010/05/06 - 1:43pm