nm12
nm12

Reputation: 101

ActionController::UnknownFormat in DashboardApp::DashboardPageController#show

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.

Upvotes: 0

Views: 196

Answers (2)

nm12
nm12

Reputation: 101

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 :)

Upvotes: 1

fabriciofreitag
fabriciofreitag

Reputation: 2883

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

Upvotes: 0

Related Questions