Class: Plutonium::UI::Page::Index

Inherits:
Base show all
Defined in:
lib/plutonium/ui/page/index.rb

Direct Known Subclasses

Definition::Base::IndexPage

Class Method Summary collapse

Methods inherited from Base

#initialize, #view_template

Methods included from Component::Behaviour

#around_template

Methods included from Component::Tokens

#classes, #tokens

Methods included from Component::Kit

#BuildActionButton, #BuildActionsDropdown, #BuildBlock, #BuildBreadcrumbs, #BuildBulkActionsToolbar, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildModalCentered, #BuildModalSlideover, #BuildPageHeader, #BuildPanel, #BuildRowActionsDropdown, #BuildSkeletonTable, #BuildTabList, #BuildTableFilterPills, #BuildTableInfo, #BuildTablePagination, #BuildTableScopesBar, #BuildTableScopesPills, #BuildTableSearchBar, #BuildTableToolbar, #BuildTableViewSwitcher, #method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from Plutonium::UI::Page::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Plutonium::UI::Component::Kit

Class Method Details

Cookie name carrying a per-resource view preference. Single source of truth — Table::Resource, Grid::Resource, and the Stimulus view-switcher controller all read from here. Underscored token-only characters keep this RFC 6265-compliant (the ‘:` form this replaces is technically forbidden, even if browsers accept it in practice).



13
14
15
# File 'lib/plutonium/ui/page/index.rb', line 13

def self.view_cookie_name(resource_class)
  "pu_view_#{resource_class.name.gsub("::", "_").underscore}"
end

Cookie Path scoped to the engine mount point (request.script_name). Two portals mounting the same resource class get independent view preferences instead of leaking through a site-wide cookie.



20
21
22
23
# File 'lib/plutonium/ui/page/index.rb', line 20

def self.view_cookie_path(request)
  path = request.script_name.to_s
  path.empty? ? "/" : path
end