Class: Plutonium::UI::Page::Index
- Inherits:
-
Base
- Object
- Component::Base
- Base
- Plutonium::UI::Page::Index
- Defined in:
- lib/plutonium/ui/page/index.rb
Direct Known Subclasses
Class Method Summary collapse
-
.view_cookie_name(resource_class) ⇒ Object
Cookie name carrying a per-resource view preference.
-
.view_cookie_path(request) ⇒ Object
Cookie Path scoped to the engine mount point (request.script_name).
Methods inherited from Base
Methods included from Component::Behaviour
Methods included from Component::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
.view_cookie_name(resource_class) ⇒ Object
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.(resource_class) "pu_view_#{resource_class.name.gsub("::", "_").underscore}" end |
.view_cookie_path(request) ⇒ Object
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.(request) path = request.script_name.to_s path.empty? ? "/" : path end |