<%
  param_names = {
    'summary.serialNumber' => 'Serial number',
    'summary.mac' => 'MAC',
    'summary.ip' => 'IP',
    'summary.softwareVersion' => 'Software version',
    'summary.productClass' => 'Product class',
  }
%>
"<%= param_names.values.join('","').html_safe %>","Last inform"
<% @devices.each do |device| %>
  "<%= param_names.collect{|k,v| device[k]['_value'] rescue ''}.join('","').html_safe %>","<%= device['summary.lastInform'] %>"
<% end %>

<%
  param_names = Rails.configuration.index_parameters
%>
"<%= param_names.keys.join('","').html_safe %>","Last inform"
<% @devices.each do |device| %>
  "<%= param_names.collect{|k,v| (p = get_param(v, device)).is_a?(String) ? p : p['_value'] rescue ''}.join('","').html_safe %>","<%= device['summary.lastInform'] %>"
<% end %>

Use the configurable index parameters when downloading devices in CSV format
Use the configurable index parameters when downloading devices in CSV format
