Filter

<% params = request.params.except(:action, :controller, :model_name) %> <% @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 %> <% @instances.each_with_index do |instance, index| %> <% @properties.each do |property| %> <% end %> <% end %>
<%= property.field.capitalize.gsub('_', ' ') %>
"> <% case property.primitive.to_s %> <% when "TrueClass" %> <% if eval("instance.#{property.field}") == true %> True"/> <% else %> False"/> <% end %> <% when "DateTime" %> <%= eval("instance.#{property.field}").strftime("%b. %d, %Y, %I:%M%p") %> <% when "Date" %> <%= eval("instance.#{property.field}").strftime("%b. %d, %Y") %> <% when "Time" %> <%= eval("instance.#{property.field}").strftime("%I:%M%p") %> <% when "Integer" %> <% if property.type.respond_to?(:flag_map) #Enum or Flag type %> <%= eval("instance.#{property.field}").to_s.capitalize.gsub('_', ' ') %> <% else %> <%= eval("instance.#{property.field}") %> <% end %> <% when "BigDecimal" %> <%= eval("instance.#{property.field}") %> <% when "Float" %> <%= eval("instance.#{property.field}") %> <% when "String" %> <%= eval("instance.#{property.field}").to_s.truncate(50) %> <% end %>

<% if @page_count.to_i > 1 %> <%= paginate(@current_page, @page_count, :url => slice_url(:admin_list, :model_name => @model_name.snake_case)) %> <% end %> <%= @model.count %> <%= @model.count == 1 ? @model_name.snake_case.gsub('_', ' ') : @model_name.snake_case.gsub('_', ' ').pluralize %> <% if @page_count.to_i == 2 %> <%= link_to("Show all", slice_url(:admin_list, :model_name => @model_name.snake_case, :all => true), :class => "showall") %> <% end %>