Merge pull request #51096 from joshuay03/fix-missing-template-error-page-with-nested-controller-paths

[Fix #51095] Missing template error page showing incorrect view path example for nested controller path
This commit is contained in:
Rafael Mendonça França 2024-04-19 16:22:55 -03:00 committed by GitHub
commit 73452ef8ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
* Fix the error page that is displayed when a view template is missing to account for nested controller paths in the
suggested correct location for the missing template.
*Joshua Young*
* Add `save_and_open_page` helper to IntegrationTest
`save_and_open_page` is a helpful helper to keep a short feedback loop when working on system tests.
A similar helper with matching signature has been added to integration tests.

View File

@ -11,7 +11,7 @@
</p>
<p>
For example, a <code><%= @exception.controller %>#<%= @exception.action_name %></code> action defined in <code>app/controllers/<%= @exception.controller.controller_path %>_controller.rb</code> should have a corresponding view template
in a file named <code>app/views/<%= @exception.controller.controller_name %>/<%= @exception.action_name %>.html.erb</code>.
in a file named <code>app/views/<%= @exception.controller.controller_path %>/<%= @exception.action_name %>.html.erb</code>.
</p>
<p>
However, if this controller is an API endpoint responding with 204 (No Content), which does not require a view template because it doesn't serve an HTML response, then this error will occur when trying to access it with a browser. In this particular scenario, you can ignore this error.