[RUBY] What to do if an ActionController :: UnknownFormat error occurs

What to do if an ActionController :: UnknownFormat error occurs

Since it came out while developing an application with rails, I will write down the remedy I took. By the way, I encountered it when I tried to implement the posting function with the new action. Image from Gyazo

new is missing a templete for this request format and variant. The request format of the new template is wrong ...? When I made a low-level translation, I noticed that there was something to read ahead. The following error statement request.formats: ["text / html"] seems to mean that the request is html and that html is (not) wrong.

When I looked at new.html.erb, the file name was typo as new.hml.erb. It was a terrible mistake, but when I fixed it, it worked fine.

Summary

If you get an ActionController :: UnknownFormat error, it's okay to check if the file name of the view is a typo, if the view is in the correct location, or if you created the view in the first place.

I hope you find it useful. Thank you for watching until the end.

Recommended Posts

What to do if an ActionController :: UnknownFormat error occurs
What to do if an error occurs when nokogiri enters when bundle install
no space left on device What to do if an error occurs
wildflly10 java8 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906 What to do if an error occurs
What to do if you get an error during rails db: reset
What to do if you get an uninitialized constant Likes Controller error
What to do and how to install when an error occurs in DXRuby 1.4.7
What to do if you get an error when you hit Heroku logs
What to do if an SSH key authentication error occurs during automatic deployment to EC2 with Capistrano
What to do if an error occurs when doing npm install axios in React + Typescript project
What to do if ClassNotFoundException occurs when starting Tomcat
What to do when a null byte error occurs
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
What to do if you get an error on heroku rake db: migrate
What to do if you should have installed Rails but an error occurs with rails -v (for beginners)
What to do when javax.batch.operations.JobStartException occurs
What to do if mysql2 gets a bundle install error
What to do if you get the error Couldn't find Item without an ID
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
What to do if you get a gcc error in Docker
What to do when a javax.el.PropertyNotWritableException occurs
What to do if you get a DISPLAY error in gym.render ()
What to do if a SAX Parser error occurs when using Liferay 7 / DXP on AWS
[Rails] What to do if you can't get an error message with the errors method
What to do if you install Ubuntu
What to do if you get an error in Basic authentication during Rails test code
[Spring Boot] What to do if an HttpMediaTypeNotAcceptableException occurs on an endpoint for which produces is set
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if the server tomcat dies
What to do if you push incorrect information
What to do if mvn archetype: generate fails
What to do when IllegalStateException occurs in PlayFramework
What to do if you get the error message unrecognized selector send to instance "***"
What to do if ffi installation fails when launching an application in Rails
What to do if an error occurs in VS Code when importing a django module or your own module installed by pip install
What to do if the debug gem installation fails
What to do if the Rails server can't start
What to do if rails server can't be stopped
What to do if TextToSpeech doesn't work on Android 11
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do if you accidentally create a model
What to do if password authentication fails in Docker/Postgres
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What to do if you get a wrong number of arguments error in binding.pry
What to do if you can't get the text of an element in Selenium
What to do if Failure / Error: require File.expand_path ('../ config / environment', __dir__) appears in RSpec
What to do if you get a port error when docker-compose up on Mac
[Memorandum] What is an error?
[Java] What to do if you get an error in Eclipse saying "Not allowed at source level below 1.X"
What to do if you get an Argument Error: wrong number of arguments (given 2, expected 0) in your RSpec test
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
What to do if you get a java.io.IOException in GlassFish
What to do when you launch an application with rails
What to do if audio is not available on discordrb
What to do if FacesMessage is set but not displayed
# What to do if you accidentally do rails db: migrate: drop
What to do if the adb command cannot be executed
What to do if you can't use the rails command
What to do if you don't see the test code error message in the terminal console
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate