app/controllers/view_components_controller.rb
# Returns either {} or {layout: value} depending on configuration
Returns either {} or {layout: value} depending on configuration
Returns either {} or { layout : value } depending on configuration
def determine_layout(layout_override = nil, prepend_views: true)
    return {} unless defined?(Rails.root)
    layout_declaration = {}
    if !layout_override.nil?
      layout_declaration[:layout] = layout_override
    elsif default_preview_layout.present?
      layout_declaration[:layout] = default_preview_layout
    end
    prepend_application_view_paths if layout_declaration[:layout].present? && prepend_views
    layout_declaration
  end
def determine_layout ( layout_override = nil , prepend_views : true ) return { } unless defined? ( Rails . root ) layout_declaration = { } if ! layout_override . nil? layout_declaration [ :layout ] = layout_override elsif default_preview_layout . present? layout_declaration [ :layout ] = default_preview_layout end prepend_application_view_paths if layout_declaration [ :layout ] . present? && prepend_views layout_declaration end
Returns either {} or {layout: value} depending on configuration
Returns either {} or { layout : value } depending on configuration
# Allow component-level override, even if false (thus no layout rendered)
layout_override
prepend_views