Module: Controllers::OpportunitiesTab
- Extended by:
- ActiveSupport::Concern
- Included in:
- CustomersController, OpportunitiesController
- Defined in:
- app/concerns/controllers/opportunities_tab.rb
Overview
Shared query logic for the "Opportunities" tab content rendered on
Customer (and other parent) show pages and inline-fetched by their
respective tab_opportunities actions.
Inclusion gives the host controller a private
build_opportunities_tab_data helper that assigns the four instance
variables the opportunities/_index partial reads:
@context_object — the parent (Customer/Contact/…)
@q — Ransack search object scoped to the context's
opportunities (or all_opportunities when the
parent aggregates across associated records)
@pagy — Pagy::Pagy paginator
@opportunities — paginated result set, ordered desc by created_at