Skip to content

Commit a4ae08a

Browse files
committed
make it possible to pass the attributes
1 parent febcd91 commit a4ae08a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/components/concerns/op_turbo/streamable.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def wrapper_key
4545
end
4646

4747
included do
48-
def render_as_turbo_stream(view_context:, action: :update, method: nil)
48+
def render_as_turbo_stream(view_context:, action: :update, method: nil, **attributes)
4949
case action
5050
when :update, *INLINE_ACTIONS
5151
@inner_html_only = true
@@ -66,14 +66,15 @@ def render_as_turbo_stream(view_context:, action: :update, method: nil)
6666
end
6767

6868
if method && !action.in?(ACTIONS_WITH_METHOD)
69-
raise ArgumentError, "The #{action} action does not supports a method"
69+
raise ArgumentError, "The #{action} action does not support a method"
7070
end
7171

7272
OpTurbo::StreamComponent.new(
7373
action:,
7474
method:,
7575
target: wrapper_key,
76-
template:
76+
template:,
77+
**attributes
7778
).render_in(view_context)
7879
end
7980

0 commit comments

Comments
 (0)