-
-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 7.1 breaks slim partial block rendering when the partial is empty #943
Comments
4 tasks
Likely fix in Rails coming: rails/rails#49612 This was only tested w/ haml, so it will need to be tested w/ slim |
I merged the Rails fix and backported to |
Fixed in Rails 7.1.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems there was a change in Rails 7.1 that broke how block rendering works with slim.
Description
After upgrading to Rails 7.1 I noticed that my page was double rendering itself in some spots. For some reason in Rails 7.1 the following code causes the parent partial to be passed to the block instead of the actual expected block:
application.html.slim
shared/_flashes.html.slim
turbo-rails/app/helpers/turbo/frames_helper.rb
https://github.com/hotwired/turbo-rails/blob/18097993736df0af3a361a253a5b920a3b5e3363/app/helpers/turbo/frames_helper.rb#L38-L43
Expected Behavior
This should render "Some Text" a single time whether or not the flash is present.
Actual Behavior
When no flash is present this for some reason re-renders the whole parent page again.
No flash present
(You can see in the screenshot below that the "Some Text" was rendered inside the turbo_frame_tag even though it was supposed to only be rendering "shared/flashes")
Flash present
(Things work as expected)
Additional Resources
rails/rails#47194 - I did a
git bisect
on rails and discovered that this is the PR with the commit causing the issue.Final thoughts
It looks like this refactor broke some things in haml as well rails/rails#47443
The text was updated successfully, but these errors were encountered: