Module: Controllers::RoomsTab

Extended by:
ActiveSupport::Concern
Included in:
OpportunitiesController, OrdersController, QuotesController
Defined in:
app/concerns/controllers/rooms_tab.rb

Overview

Shared query logic for the "Rooms & Areas" tab content rendered on
Quote / Order / Opportunity show pages and inline-fetched by their
respective tab_rooms actions.

Inclusion gives the host controller a private build_rooms_tab_data
helper that assigns the four instance variables the _tab_table
partial expects:

@q — Ransack search object scoped to context.room_configurations
@pagy — Pagy::Pagy paginator
@room_configurations — paginated, includes-eager-loaded result set
@room_priorities — distinct priority values for the filter dropdown
@room_statuses — distinct state values for the filter dropdown

The host controller is responsible for supplying the context
usually @quote, @order, or @opportunity set by before_actions.