Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

enable status code usage when responding with turbo streams

Jonas Jabariea80fa944170
diff --git a/app/controllers/concerns/op_turbo/component_stream.rb b/app/controllers/concerns/op_turbo/component_stream.rb
index 585c2411c72..0597d3b2210 100644
--- a/app/controllers/concerns/op_turbo/component_stream.rb
+++ b/app/controllers/concerns/op_turbo/component_stream.rb
@@ -30,13 +30,13 @@ module OpTurbo
module ComponentStream
extend ActiveSupport::Concern
- def respond_to_with_turbo_streams(&format_block)
+ def respond_to_with_turbo_streams(status: :ok, &format_block)
respond_to do |format|
format.turbo_stream do
render turbo_stream: turbo_streams, status:
end
- format_block.call(format) if block_given?
+ yield(format) if format_block
end
end
alias_method :respond_with_turbo_streams, :respond_to_with_turbo_streams