Resources

<%= link_to 'New Resource', new_resource_path, :class => "btn" if can? :create, Resource %> <% unless @resources.blank? %> <% @resources.group_by(&:supercategory).each do |supercategory,resources| %> <% resources.each do |resource| %> <% end %> <% end %> <% end %>
<%= sort_link 'Owner', :owner_id %> <%= sort_link 'Category', :category_id %> <%= sort_link 'Name', :name %> <%= sort_link 'Serial', :serial %> <%= sort_link 'Status/Location', :status %>
<%= supercategory %>
<%= link_to image_tag(resource.picture.url(:tiny)), resource.picture.url, :popup => ['index_image_preview', 'height=300,width=400'] if resource.picture? %> <%=h resource.owner.name if resource.owner %> <%=h resource.category.name unless resource.category.nil? %> <%=h resource.name %> <%=h resource.serial %> <%=h resource.status %> <%= link_to 'Edit', edit_resource_path(resource) if can? :update, resource %> <%= link_to 'Destroy', resource, :confirm => 'Are you sure you want to delete this?', :method => :delete if can? :destroy, resource %>