ActionController::UnknownFormat in DashboardApp::DashboardPageController#show

188 views Asked by At

I'm in the process of a URL rename and had all of the routes working but received a suggestion to go back through and update some additional names and now I am running into this error. I have show.html.erb in app/views/dashboard/dashboard_page.

I have been stuck on this for far too long, messing with file names, but I can't get past it. Any guidance would be great!

Full error message: DashboardApp::DashboardPageController#show is missing a template for this request format and variant. request.formats: ["text/html"] request.variant: [] NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.

2

There are 2 answers

0
nm12 On

The solution: I had a typo in a file name and I needed to restart my webpack server. I had been restarting my rails server but didn't think to do webpack. Hopefully this saves someone else hours of head banging :)

3
fabriciofreitag On

Unless you're namespacing your controller or doing additional configuration, your folder structure should match your controller name.

So show.html.erb should be inside the app/views/dashboard_page folder.

OBS:

if DashboardApp is a namespace, then show.html.erb should be inside app/views/dashboard_app/dashboard_page