-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
OptimizedFileSystemResolver doesn't sort views considering request format #37556
Comments
Fixed by #37557 |
I'm not entirely clear on how Rails releases work, and also not sure exactly where to write this! Apologies if it's not the place. This issue is preventing me from upgrading to Rails 6. I noticed it's in the |
@aardvarkk Major and minor releases are cut from This fix hasn't yet been backported from For now, as a workaround, I've found that adding a respond_to do |format|
format.html { }
format.json { }
end |
@jonathanhefner Thanks very much for your detailed response. I had determined that a workaround was possible, but I'm working with a fairly large legacy codebase and was trying to avoid a large diff for the Rails 6 upgrade. We're not in a huge rush to upgrade so I guess the best option is likely to wait for the 6.1 release. Thanks again! |
Steps to reproduce
rails new bug
rails generate controller users index
echo "json.foo 'bar'" > app/views/users/index.json.jbuilder
rails s
Expected behavior
The request should prioritize the format passed by
Accept: application/json, text/javascript, */*; q=0.01
header and render theindex.json.jbuilder
view.Actual behavior
The
index.html.erb
view is rendered.System configuration
Rails version:
6.0.0
Ruby version:
2.5.5
Additional Information
With rails 5.2.3 it works perfectly. But rails 6 uses faster globs for template resolving which sorts files without prioritizing format.
The text was updated successfully, but these errors were encountered: