Consider an example where I have an Orders
model. Triggering the index
action shows all of the orders in the system.
Now I want to have a separate page that displays a chart of all refunded orders and another page that displays all cancelled orders--not only is there now a filter, but a whole new view as well.
What would be a best practice:
1.) Creating new actions in OrdersController
for each report (e.g., refund_report
and cancelled_report
)
2.) Creating new controllers for each report (e.g., RefundReportController
, CancellationReportController
) with a single show
action?
3.) Creating one new controller for all reports (e.g., OrderReportsController
) and an action for each report (e.g., refunds
, cancellations
, etc.
Or is there another paradigm I'm missing altogether?