Module: LcpRuby::ViewSlotHelper
- Defined in:
- app/helpers/lcp_ruby/view_slot_helper.rb
Instance Method Summary collapse
Instance Method Details
#render_slot(slot, page:) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/lcp_ruby/view_slot_helper.rb', line 3 def render_slot(slot, page:) components = ViewSlots::Registry.components_for(page, slot) return "".html_safe if components.empty? context = build_slot_context(page) results = components.filter_map do |component| next unless component.enabled?(context) render partial: component.partial, locals: { slot_context: context } end safe_join(results) end |