Module: Layered::Assistant::PanelHelper
- Defined in:
- app/helpers/layered/assistant/panel_helper.rb
Instance Method Summary collapse
- #layered_assistant_panel_body(**options) ⇒ Object
-
#layered_assistant_panel_header(**options, &block) ⇒ Object
Renders the Turbo Frame tags that connect the layered-ui panel to the assistant engine.
- #layered_assistant_public_panel_body(assistant:, **options) ⇒ Object
Instance Method Details
#layered_assistant_panel_body(**options) ⇒ Object
25 26 27 28 29 |
# File 'app/helpers/layered/assistant/panel_helper.rb', line 25 def layered_assistant_panel_body(**) turbo_frame_tag "assistant_panel", src: layered_assistant.panel_conversations_path, ** end |
#layered_assistant_panel_header(**options, &block) ⇒ Object
Renders the Turbo Frame tags that connect the layered-ui panel to the assistant engine. Call this inside your layout’s content_for blocks:
<% content_for :l_ui_panel_heading do %>
<%= layered_assistant_panel_header %>
<% end %>
<% content_for :l_ui_panel_body do %>
<%= layered_assistant_panel_body %>
<% end %>
The header frame is populated by the engine’s panel views. The body frame lazy-loads the conversation list from the engine’s panel routes.
Any extra keyword arguments are forwarded to the respective turbo_frame_tag call as HTML attributes.
21 22 23 |
# File 'app/helpers/layered/assistant/panel_helper.rb', line 21 def layered_assistant_panel_header(**, &block) turbo_frame_tag "assistant_panel_header", **, &block end |
#layered_assistant_public_panel_body(assistant:, **options) ⇒ Object
31 32 33 34 35 |
# File 'app/helpers/layered/assistant/panel_helper.rb', line 31 def layered_assistant_public_panel_body(assistant:, **) turbo_frame_tag "assistant_panel", src: layered_assistant.public_panel_conversations_path(assistant_id: assistant.id), ** end |