Repository navigation
Conversation
With `config.slots = true`, `Slots::Resolver` is prepended to the view paths and answers any lookup whose formats include `:slots`. A lookup with default formats lists every registered format, `:slots` among them, so the prepended resolver wins and the render returns the values Hash where the caller expected markup. The resolver now returns nothing unless `:slots` is the first requested format. A slots request still resolves as before, and everything else falls through to the resolvers Rails built. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mattboldt
marked this pull request as ready for review
October 24, 2026 18:33
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello! Another one from setting up ReActionView on my app (the first was marcoroth/herb#2778). Same disclosure as last time: I leaned on Claude for a lot of the digging here.
With
config.slots = true,Slots::Resolveris prepended to the view paths and rebuilds every HTML template with the:slotsformat. It answers any lookup whose formats include:slots. Once the MIME type is registered, a lookup with default formats lists every registered format,:slotsamong them, so the prepended resolver wins and the render returns the values Hash where the caller expected markup.In our app this showed up as about 31
no implicit conversion of Hash into Stringerrors from renders that aren't pinned to[:html]:ActionView::TestCaseview tests, ViewComponent tests, andtemplate.renderinside simple_form inputs.This makes the resolver return nothing unless
:slotsis the first requested format. A slots request still resolves as before, and everything else falls through to the resolvers Rails built.Tested with
test/slots/resolver_test.rb, which gets a case for a lookup that lists:slotsafter:html, andbundle exec rake teston this branch rebased onto currentmain(234 runs, 0 failures, 3 skips). We've been running it as a local patch on 0.6.0: the lookup above returns:html, a[:slots]lookup still returns:slots, and all 31 of those errors go away.