Report Serializer Demo

Form

<%= form_tag request.fullpath, method: 'get', id: 'report-form', autocomplete: 'off' do %> <%= Repor::Serializers::FormFieldSerializer.new(@report).html_fields %>


<%= submit_tag 'Run report', class: 'pure-button pure-button-primary' %> <% end %>

CSV


<%= link_to 'Download CSV', request.query_parameters.merge(format: 'csv'), class: 'pure-button pure-button-primary' %>

Chart

<% table = Repor::Serializers::TableSerializer.new(@report) %>

Table

<% table.headers.each do |th| %><% end %> <% table.each_row do |row| %> <% row.each do |td| %><% end %> <% end %>
<%= table.caption %>
<%= th %>
<%= td %>
<% chart = Repor::Serializers::HighchartsSerializer.new(@report) %>