###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)