%table.table.table-hover#assets_datatable
  %thead
    %tr
      - SystemConfig.transam_module_names.each do |mod|
        = render :partial => "#{mod}_asset_dt_head" rescue nil
      %th.right Mileage
      %th.center

  %tbody
    - assets.each do |a|
      %tr{:data => {:action_path => inventory_path(a)}}
        - SystemConfig.transam_module_names.each do |mod|
          = render :partial => "#{mod}_asset_dt_columns", :locals => {:a => a } rescue nil
          
        %td.right= format_as_integer(a.reported_mileage)
        %td.center= render :partial => 'assets/asset_info_detail_popup', :locals => {:asset => a}

= render :partial => 'shared/datatable_javascript', :locals => {:id => 'assets_datatable'}

:javascript
$(document).ready(function() {
  $('.popup-details').bind({
    mouseenter: function() {
      var el=$(this);  
      $.ajax({
        type: "GET",
        url: el.attr("data-url"),
        dataType: "html",
        success: function(data) {
          el.attr("data-content", data);
          el.popover('show');
        }
      });
    },
    mouseleave: function() {
      var el=$(this);
      el.popover('hide');
    }
  });
});

%table.table.table-hover#assets_datatable
  %thead
    %tr
      - SystemConfig.transam_module_names.each do |mod|
        = render :partial => "#{mod}_asset_dt_head" rescue nil
      %th.right Mileage
      %th.center

  %tbody
    - assets.each do |a|
      %tr{:data => {:action_path => inventory_path(a)}}
        - SystemConfig.transam_module_names.each do |mod|
          = render :partial => "#{mod}_asset_dt_columns", :locals => {:a => a } rescue nil
          
        %td.right= format_as_integer(a.reported_mileage)
        %td.center= render :partial => 'assets/asset_info_detail_popup', :locals => {:asset => a}

= render :partial => 'shared/popover_javascript'
= render :partial => 'shared/datatable_javascript', :locals => {:id => 'assets_datatable'}
Convert vehicle datatable to use shared javascript
Convert vehicle datatable to use shared javascript
