-
I have a menu component with a polymorphic slot for things like links or modal views etc. The menu items render based on policies. Is it possible to have the menu render only if any of the items are visible? Is it possible to manually check the visibility of slots? |
Beta Was this translation helpful? Give feedback.
Answered by
Spone
Aug 6, 2022
Replies: 1 comment 2 replies
-
Have you tried something like: class ParentComponent < ApplicationComponent
renders_many :items # [...]
def render?
items.any?(&:render?)
end
end |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
coder2000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you tried something like: