Module: Controllers::OrdersTab

Extended by:
ActiveSupport::Concern
Included in:
CustomersController, OrdersController
Defined in:
app/concerns/controllers/orders_tab.rb

Overview

Shared query logic for the "Orders" tab content rendered on
Customer (and other parent) show pages and inline-fetched by their
respective tab_orders actions.

Inclusion gives the host controller a private build_orders_tab_data
helper that assigns the four instance variables the orders/_index
partial reads:

@context_object — the parent (Customer/Contact/…)
@q — Ransack search object scoped to the context's
orders (or all_orders when the parent
aggregates across associated records)
@pagy — Pagy::Pagy paginator
@orders — paginated result set