英文:
Trubo Rails appends content to outside of the body
问题
originally based on:
https://github.com/heartcombo/devise/issues/5564
My Turbo Rails 7 app appears to respond correctly but appends content to outside of the body, leaving the rest of the body in place:
Start the server with ./bin/dev
Go to http://127.0.0.1:3000/users/sign_up
Input test username & password
Click "Sign Up"
here's what the Rails log says:
Notice that if you examine the HTML, the "hello world" — which is the correct response from welcome/index.erb
, get appended outside of the closing <body>
tag
Expected result:
• The signup form goes away and the user is correctly taken to the home page
英文:
originally based on:
https://github.com/heartcombo/devise/issues/5564
My Turbo Rails 7 app appears to respond correctly but appends content to outside of the body, leaving the rest of the body in place:
Start the server with ./bin/dev
Go to http://127.0.0.1:3000/users/sign_up
Input test username & password
Click "Sign Up"
here's what the Rails log says:
Notice that if you examine the HTML, the "hello world" — which is the correct response from welcome/index.erb
, get appended outside of the closing <body>
tag
Expected result:
• The signup form goes away and the user is correctly taken to the home page
答案1
得分: 1
这发生在响应的模板不正确地具有格式时,例如 .html
。
解决方法:将 index.erb
重命名为 index.html.erb
。
英文:
This happens when the template that is being responded with doesn't correctly have a format e.g. .html
to fix: rename index.erb
to index.html.erb
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论