Module: Controllers::UploadsTab
- Extended by:
- ActiveSupport::Concern
- Included in:
- CustomersController, OpportunitiesController, OrdersController, QuotesController, UploadsController
- Defined in:
- app/concerns/controllers/uploads_tab.rb
Overview
Shared query logic for the "Attachments" tab content rendered on
Quote / Order / Opportunity / Customer (and other) show pages and
inline-fetched by their respective tab_attachments actions.
Inclusion gives the host controller a private build_uploads_tab_data
helper that assigns the three instance variables the
uploads/_uploads partial reads:
@context_object — the parent the partial uses for action templates
@q — Ransack search object scoped to context uploads
@pagy — Pagy::Pagy paginator
@uploads — paginated result set
The host controller is responsible for supplying the context —
usually @quote, @order, @opportunity, @customer etc. set by
before_actions.