Trubo Rails将内容附加到页面主体之外。

huangapple go评论61阅读模式
英文:

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

Trubo Rails将内容附加到页面主体之外。

Click "Sign Up"

Current behavior
Trubo Rails将内容附加到页面主体之外。

here's what the Rails log says:

Trubo Rails将内容附加到页面主体之外。

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

Trubo Rails将内容附加到页面主体之外。

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

Trubo Rails将内容附加到页面主体之外。

Click "Sign Up"

Current behavior
Trubo Rails将内容附加到页面主体之外。

here's what the Rails log says:

Trubo Rails将内容附加到页面主体之外。

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 &lt;body&gt; tag

Trubo Rails将内容附加到页面主体之外。

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

huangapple
  • 本文由 发表于 2023年3月4日 00:46:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75629764.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定