40 lines
1008 B
Plaintext
40 lines
1008 B
Plaintext
<h1>Excel Replacement Dashboard</h1>
|
|
|
|
<!-- Dropdown Filters Form -->
|
|
<%= form_with url: dashboard_path, method: :get, local: true do |f| %>
|
|
<div>
|
|
<%= f.label :category, "Select Category:" %>
|
|
<%= f.select :category, options_for_select(@available_categories, params[:category]), include_blank: "All Categories" %>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.label :region, "Select Region:" %>
|
|
<%= f.select :region, options_for_select(@available_regions, params[:region]), include_blank: "All Regions" %>
|
|
</div>
|
|
|
|
<%= f.submit "Filter Data" %>
|
|
<% end %>
|
|
|
|
<hr>
|
|
|
|
<!-- Displaying the Data in Specific Locations / Table -->
|
|
<h2>Dashboard Results</h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Column 1</th>
|
|
<th>Column 2</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @records.each do |record| %>
|
|
<tr>
|
|
<td><%= record.category_column %></td>
|
|
<td><%= record.region_column %></td>
|
|
<td><%= record.metric_value_column %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|