Class: Plutonium::UI::DynaFrame::Content

Inherits:
Component::Base show all
Includes:
Phlex::Rails::Helpers::TurboFrameTag
Defined in:
lib/plutonium/ui/dyna_frame/content.rb

Overview

Conditionally wraps its content in a turbo-frame matching the inbound request’s ‘Turbo-Frame` header. In frame mode adds the flash partial so toast/alert messages still surface inside frames; in non-frame mode renders the block as-is.

Instance Method Summary collapse

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?

Dynamic Method Handling

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

Instance Method Details

#view_template(&block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/plutonium/ui/dyna_frame/content.rb', line 11

def view_template(&block)
  if current_turbo_frame.present?
    turbo_frame_tag(current_turbo_frame) do
      render partial("flash")
      yield if block_given?
    end
  elsif block_given?
    yield
  end
end