class GedStatusController < ApplicationController
def show
if params.has_key? :xls
headers['Content-Type'] = "application/vnd.ms-excel"
headers['Content-Disposition'] = 'attachment; filename="ged_status_report.csv"'
headers['Cache-Control'] = ''
render :template => "ged_status/show_csv",:layout => false
end
end
end
in show.rhtml
Client ID,Client Name
<% for r_s in @ged_report_statuses -%>
<%= r_s.client_id -%>,"<%= r_s.client_name -%>"<% end %>