Module: Phlex::Rails::Layout
- Includes:
- Helpers::ActionCableMetaTag, Helpers::AutoDiscoveryLinkTag, Helpers::CSPMetaTag, Helpers::CSRFMetaTags, Helpers::FaviconLinkTag, Helpers::JavascriptImportModuleTag, Helpers::JavascriptImportmapTags, Helpers::JavascriptIncludeTag, Helpers::PreloadLinkTag, Helpers::StylesheetLinkTag, Helpers::TurboRefreshMethodTag, Helpers::TurboRefreshScrollTag
- Defined in:
- lib/phlex/rails/layout.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#turbo_refresh_scroll_tag
#register_output_helper, #register_value_helper
#turbo_refresh_method_tag
#javascript_import_module_tag
#javascript_importmap_tags
#javascript_include_tag
#auto_discovery_link_tag
#action_cable_meta_tag
#stylesheet_link_tag
#preload_link_tag
#favicon_link_tag
#csrf_meta_tags
#csp_meta_tag
Class Method Details
.included(klass) ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/phlex/rails/layout.rb', line 39
def self.included(klass)
unless klass < Phlex::HTML
raise Phlex::ArgumentError.new("👋 #{name} should only be included into Phlex::HTML classes.")
end
klass.extend(Interface)
end
|
Instance Method Details
#identifier ⇒ Object
64
65
66
|
# File 'lib/phlex/rails/layout.rb', line 64
def identifier
self.class.identifier
end
|
#render(view_context = nil, *args, **kwargs, &block) ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/phlex/rails/layout.rb', line 47
def render(view_context = nil, *args, **kwargs, &block)
if @_context
super
else
call(view_context: view_context) do |yielded|
case yielded
when Symbol
output = view_context.view_flow.get(yielded)
else
output = view_context.capture(&block)
end
unsafe_raw output
end
end
end
|
#virtual_path ⇒ Object
68
69
70
|
# File 'lib/phlex/rails/layout.rb', line 68
def virtual_path
self.class.virtual_path
end
|