forked from hotwired/turbo-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure
turbo-stream[action="remove"]
does not render
Closes [hotwired#679][] Prior to this change, calls to `Turbo::Streams::Broadcasts#broadcast_remove_to` would render a view partial that corresponds to the model *regardless* of whether or not the contents of that render would be included in the broadcast `<turbo-stream>` element. Not only is it wasteful to render HTML and then do nothing with it, it also poses the risk of failing due to errors raised during the rendering process. This commit restructures the contents of the `Turbo::Streams::Broadcasts#broadcast_action_to` method to skip extraneous rendering if `render: false` is passed. In addition, it ensures that calls to `broadcast_remove_to` pass `render: false` by default. [hotwired#679]: hotwired#679
- Loading branch information
1 parent
780ee0d
commit 51aa2a5
Showing
3 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= raise "Failed to render" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters