Skip to content

Commit 73452ef

Browse files
authored
Merge pull request rails#51096 from joshuay03/fix-missing-template-error-page-with-nested-controller-paths
[Fix rails#51095] Missing template error page showing incorrect view path example for nested controller path
2 parents 409fa29 + 79f2099 commit 73452ef

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

actionpack/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
* Fix the error page that is displayed when a view template is missing to account for nested controller paths in the
2+
suggested correct location for the missing template.
3+
4+
*Joshua Young*
5+
16
* Add `save_and_open_page` helper to IntegrationTest
27
`save_and_open_page` is a helpful helper to keep a short feedback loop when working on system tests.
38
A similar helper with matching signature has been added to integration tests.

actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</p>
1212
<p>
1313
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
14-
in a file named <code>app/views/<%= @exception.controller.controller_name %>/<%= @exception.action_name %>.html.erb</code>.
14+
in a file named <code>app/views/<%= @exception.controller.controller_path %>/<%= @exception.action_name %>.html.erb</code>.
1515
</p>
1616
<p>
1717
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.

0 commit comments

Comments
 (0)