rails icon indicating copy to clipboard operation
rails copied to clipboard

Template details defined in strings should either throw or be accepted correctly.

Open axos88 opened this issue 1 year ago • 2 comments

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

axos88 avatar Jul 22 '22 07:07 axos88

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.

ghiculescu avatar Aug 02 '22 19:08 ghiculescu

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.

natematykiewicz avatar Aug 09 '22 05:08 natematykiewicz

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.

rails-bot[bot] avatar Aug 16 '22 20:08 rails-bot[bot]