Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
###RHTML#### <div id="welcome_photos"> <% if @home_page_photos.length > 0 %> <div id="photo"> <img src="<%= @home_page_photos.first.public_filename -%>" alt="home page photo" /> </div> <div id="caption"> <%= @home_page_photos.first.caption %> </div> <% end %> <p> <% @home_page_photos.each_with_index do |home_page_photo, i| %> <% i += 1 %> <% unless i == 1 -%>| <% end -%><%= link_to_remote i, :url => {:controller => :site, :action => :get_home_page_photo, :id => home_page_photo} %> <% end %> </p> </div> ####RJS#### page['caption'].replace_html = @home_page_photo.caption page['photo'].replace_html = image_tag(@home_page_photo.public_filename)
This paste will be private.
From the Design Piracy series on my blog: