diff options
author | Vinicius Stock <instantink+pair+vinicius@hp.com> | 2017-05-30 11:12:34 -0300 |
---|---|---|
committer | Vinicius Stock <instantink+pair+vinicius@hp.com> | 2018-04-20 11:01:05 -0300 |
commit | 297a579de4f8cb8d8144b18d85ee370558c0977c (patch) | |
tree | f2ebeb2d607805869d8e1d354a8bddfaf046ae00 /actionpack/lib/action_dispatch/middleware/templates | |
parent | b6ee4e4b989bfc2fe50b2b830fdcb90ef9e23d9a (diff) | |
download | rails-297a579de4f8cb8d8144b18d85ee370558c0977c.tar.gz rails-297a579de4f8cb8d8144b18d85ee370558c0977c.tar.bz2 rails-297a579de4f8cb8d8144b18d85ee370558c0977c.zip |
Create MissingExactTemplate exception with separate template
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/templates')
2 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb new file mode 100644 index 0000000000..3621ea81de --- /dev/null +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb @@ -0,0 +1,19 @@ +<header> + <h1>No template for interactive request</h1> +</header> + +<div id="container"> + <h3><%= h @exception.message %></h3> + + <p class="summary"> + <strong>NOTE!</strong><br> + Unless told otherwise, Rails expects an action to render a template with the same name,<br> + contained in a folder named after its controller. + + If this controller is an API responding with 204 (No Content), <br> + which does not require a template, + then this error will occur when trying to access it via browser,<br> + since we expect an HTML template + to be rendered for such requests. If that's the case, carry on. + </p> +</div> diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb new file mode 100644 index 0000000000..fcdbe6069d --- /dev/null +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb @@ -0,0 +1,3 @@ +Missing exact template + +<%= @exception.message %> |