rails
rails copied to clipboard
Template details defined in strings should either throw or be accepted correctly.
Steps to reproduce
- Create a template app/views/foo/bar.text.erb
details = { locale: ['en'], formats: ['text'], handlers: ['erb'], variants: []}
ActionController::Base.view_paths.find('bar', 'foo', false, details, nil, [])
Expected behavior
Rails should either throw an exception saying that details must be supplied as symbols, or the template should be correctly returned
Actual behavior
Silently fails to find the otherwise existing template, specifying the correct directory it the file resides in. Confustion intensifies.
System configuration
Rails version: 7.0.3 Ruby version: 2.7.6
It's not really clear to me what the issue is here... would it be possible to make a simple replication app that shows the issue? Then we can clone it, replicate it, and test fixes against it.
Based on this seemingly related issue https://github.com/rails/rails/issues/45636, I think this issue is implying that 'text'
needs to be :text
(same with :erb), and that either the string should work, or the method should error explaining that it needs to be a symbol instead because rendering a template not found error is confusing.
This issue has been automatically closed because there has been no follow-up response from the original author. We currently don't have enough information in order to take action. Please reach out if you have any additional information that will help us move this issue forward.