Skip to content

Commit

Permalink
Handle kwargs in unbuffered calls
Browse files Browse the repository at this point in the history
  • Loading branch information
willcosgrove committed Sep 9, 2024
1 parent 512cc2d commit 10a8be5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/phlex/rails/unbuffered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ def respond_to_missing?(...)
@component.respond_to?(...)
end

def method_missing(method_name, *, &erb)
def method_missing(method_name, *, **, &erb)
if @component.respond_to?(method_name)
output = @component.capture do
if erb
@component.public_send(method_name, *) do
@component.public_send(method_name, *, **) do
@component.raw(
@component.helpers.capture(
&erb
),
)
end
else # no erb block
@component.public_send(
method_name,
*,
)
@component.public_send(method_name, *, **)
end
end
else
Expand Down

0 comments on commit 10a8be5

Please sign in to comment.