Module: StudioSidebarHelper
- Defined in:
- app/helpers/studio_sidebar_helper.rb
Overview
The link-sidebar's view seam. Exposed to host views automatically (the engine is non-isolated), so the navbar and any host layout can gate on studio_sidebar? without wiring. Sections resolve once per render pass — the resolver may call a host lambda that walks models or routes.
Instance Method Summary collapse
- #studio_sidebar? ⇒ Boolean
-
#studio_sidebar_replaces_admin_menu? ⇒ Boolean
The admin dropdown and the sidebar trigger share the cog glyph — showing both reads as a double gear.
- #studio_sidebar_sections ⇒ Object
Instance Method Details
#studio_sidebar? ⇒ Boolean
10 11 12 |
# File 'app/helpers/studio_sidebar_helper.rb', line 10 def .any? end |
#studio_sidebar_replaces_admin_menu? ⇒ Boolean
The admin dropdown and the sidebar trigger share the cog glyph — showing both reads as a double gear. When the viewer's resolved sections carry an admin-flagged entry, the sidebar IS the admin menu (its title says so) and the engine components skip the dropdown. Declaring only public sections keeps the dropdown, so admins never lose Theme/Navbar/Error Logs.
19 20 21 |
# File 'app/helpers/studio_sidebar_helper.rb', line 19 def .any? { |section| section[:admin] } end |
#studio_sidebar_sections ⇒ Object
6 7 8 |
# File 'app/helpers/studio_sidebar_helper.rb', line 6 def @studio_sidebar_sections ||= Studio.(self) end |