<% params = request.params.except(:action, :controller, :model_name) %>
<% @properties.each do |property| %> <% name = property[:name] %> <% pretty_name = property[:pretty_name] %> <% end %> <% @objects.each_with_index do |object, index| %> <% @properties.each do |property| %> <% type = property[:type] %> <% name = property[:name] %> <% end %> <% end %>
<%= pretty_name %>
<% case type %> <% when :boolean %> <% if object.send(name) == true %> True"/> <% else %> False"/> <% end %> <% when :date_time %> <% value = object.send(name) %> <%= value.respond_to?(:strftime) ? value.strftime("%b. %d, %Y, %I:%M%p") : nil %> <% when :date %> <% value = object.send(name) %> <%= value.respond_to?(:strftime) ? value.strftime("%b. %d, %Y") : nil %> <% when :time %> <% value = object.send(name) %> <%= value.respond_to?(:strftime) ? value.strftime("%I:%M%p") : nil %> <% when :string %> <%= object.send(name).to_s.truncate(50) %> <% when :text %> <%= object.send(name).to_s.truncate(50) %> <% else %> <%= object.send(name) %> <% end %>

<% if @page_count.to_i > 1 %> <%= paginate(@current_page, @page_count, :url => '?' + Merb::Parse.params_to_query_string(params)) %> <% end %> <%= @record_count %> <%= @record_count == 1 ? @abstract_model.pretty_name.downcase : @abstract_model.pretty_name.downcase.pluralize %> <% if @page_count.to_i == 2 %> <%= link_to("Show all", '?' + Merb::Parse.params_to_query_string(params.merge(:all => true)), :class => "showall") %> <% end %>