Rails126.96.36.199 Ruby 2.6.3 I am building an application in the environment.
DB registration is successful on the controller and I am trying to redirect.
However, it cannot be redirected because the following redirect URL changes.
I would like to borrow the wisdom of those who have been able to meet and resolve similar events.
I'm running with the redirect_to method specifying the url,
The following is output on the log and cannot be redirected.
Redirected to http: // localhost: 3000/XXXX/YY
Completed 406 Not Acceptable in 200ms (ActiveRecord: 119.1ms)
ActionController :: UnknownFormat (ActionController :: UnknownFormat):
It will be.
url ='/ XXXX /'+ YY
Looking at the Fidder tool, the url of the request is
It's your own controller path, not/XXXX/YY
Furthermore, the Content-Type was text/plain instead of text/html.
I think this is probably the cause of UnknownFormat.
Answer # 1
This case has been resolved. I was just looking at the controller redirect_to,
The cause was that the form tag was specified so that the screen was updated asynchronously.
I understood by looking at the following article.
<% = form_with model: @XXXX_XXXX do | f |%>
However, I added local: true as shown below.
<% = form_with model: @XXXX_XXXX, local: true do | f |%>
We would like to thank winterboum for his cooperation, and we received a polite answer until the end on a precious Sunday.
Thank you. Thank you very much.
Answer # 2
Is the result of url ='/ XXXX /'+ YY'/ XXXX/YY'?
Then trying to redirect to http: // localhost: 3000/XXXX/YY is the right thing to do.
Where do you really want to go?
- ruby on rails - rspec test changed by -1, but was changed by 0 error
- ruby on rails - when i changed the data type, i got an sql error i don't know where the cause is
- ruby on rails 6 - i changed the project name of rails, but it became inaccessible
- ruby - the last db setting doesn't work when deploying rails app on aws
- ruby on rails - access fails after seed after deploying to heroku
- ruby on rails - i want to implement a function for administrator users to register luggage for general users in rails
- ruby on rails - things associated with a foreign key cannot be called in view
- ruby on rails 6 - environment construction of ruby on rails
- ruby on rails 5 - actioncontroller :: invalidauthenticitytoken cannot be resolved
- ruby on rails - error in controller when transitioning with rails6 destory action
- ruby on rails runtime error cannot be resolved
- ruby on rails - rails s can't
- ruby on rails - missing required keys: i'm having trouble resolving the [: id] error
- ruby on rails 5 - some items are not saved in db when posting from rails form
- bootstrap display in ruby on rails is broken
- ruby - [rails] i can't install the add favorite button
- ruby on rails - dealing with wrong number of arguments (given 1, expected 2)
- ruby on rails - seed fails on heroku
- ruby on rails - cannot pass id to destroy action of intermediate table
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable