app/views/simple_admin/admin/index.html.erb in simple_admin-0.1.0 vs app/views/simple_admin/admin/index.html.erb in simple_admin-0.2.1
- old
+ new
@@ -34,11 +34,11 @@
<% @collection.each do |object| %>
<tr class="<%= cycle('odd', 'even') %>">
<% @interface.attributes_for(:index).each do |col| %>
<td>
<% if col.data %>
- <%= col.data.call(object, col) %>
+ <%= instance_exec(object, &col.data) %>
<% else %>
<%= pretty_format(object.send(col.attribute)) %>
<% end %>
</td>
<% end %>
@@ -64,10 +64,10 @@
<div class="panel sidebar_section" id="filters_sidebar_section">
<h3>Filters</h3>
<div class="panel_contents">
<%= form_tag '', :class => "q_search", :id => "q_search", :method => "get" do %>
<% @interface.filters_for(:index).each do |col| %>
- <%= filter_for(col.attribute, @interface.constant) %>
+ <%= filter_for(col.attribute, @interface.constant, col.options) %>
<% end %>
<div class="buttons">
<input name="commit" type="submit" value="Filter" />
<a href="#" class="clear_filters_btn">Clear Filters</a>
<input id="order" name="order" type="hidden" value="id_desc" />