<% params = request.params.except(:action, :controller, :model_name) %>

Filter

<% @properties.each do |property| %> <% if property.primitive.to_s == "TrueClass" %>

By <%= property.field.gsub('_', ' ') %>

<% elsif property.primitive.to_s == "Integer" && property.type.respond_to?(:flag_map) %>

By <%= property.field.gsub('_', ' ') %>

<% end %> <% end %>
<% @properties.each do |property| %> <% end %> <% @objects.each_with_index do |object, index| %> <% @properties.each do |property| %> <% end %> <% end %>
"true"} : {})) %>"><%= property.field.capitalize.gsub('_', ' ') %>
"> <% case property.primitive.to_s %> <% when "TrueClass" %> <% if eval("object.#{property.field}") == true %> True"/> <% else %> False"/> <% end %> <% when "DateTime" %> <% value = eval("object.#{property.field}") %> <%= value.respond_to?(:strftime) ? value.strftime("%b. %d, %Y, %I:%M%p") : nil %> <% when "Date" %> <% value = eval("object.#{property.field}") %> <%= value.respond_to?(:strftime) ? value.strftime("%b. %d, %Y") : nil %> <% when "Time" %> <% value = eval("object.#{property.field}") %> <%= value.respond_to?(:strftime) ? value.strftime("%I:%M%p") : nil %> <% when "Integer" %> <% if property.type.respond_to?(:flag_map) #Enum or Flag type %> <%= eval("object.#{property.field}").to_s.capitalize.gsub('_', ' ') %> <% else %> <%= eval("object.#{property.field}") %> <% end %> <% when "BigDecimal" %> <%= eval("object.#{property.field}") %> <% when "Float" %> <%= eval("object.#{property.field}") %> <% when "String" %> <%= eval("object.#{property.field}").to_s.truncate(50) %> <% 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 ? @model_name.snake_case.gsub('_', ' ') : @model_name.snake_case.gsub('_', ' ').pluralize %> <% if @page_count.to_i == 2 %> <%= link_to("Show all", '?' + Merb::Parse.params_to_query_string(params.merge(:all => true)), :class => "showall") %> <% end %>