Skip to content
Discussion options

You must be logged in to vote

Updated syntax to leverage Ruby 2.7+ argument forwarding with ...:

# frozen_string_literal: true

class ParentComponent < ViewComponent::Base
  renders_one :child, ChildComponent

  def with_grandchild(...)
    with_child { |child| child.with_grandchild(...) }
  end
end

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Spone
Comment options

Spone Feb 1, 2023
Maintainer

Comment options

You must be logged in to vote
0 replies
Answer selected by joelhawksley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants