Skip to content

Rendering parent if slots visible #1457

Answered by Spone
coder2000 asked this question in Q&A
Discussion options

You must be logged in to vote

Have you tried something like:

class ParentComponent < ApplicationComponent
  renders_many :items # [...]

  def render?
    items.any?(&:render?)
  end
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@coder2000
Comment options

@Spone
Comment options

Spone Aug 6, 2022
Maintainer

Answer selected by coder2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants