在哪里为rails`link_to'配置默认协议?

发布于 2025-02-06 17:39:37 字数 322 浏览 1 评论 0原文

rails link_to生成了http:// prfeix的链接。但是网站是https

因此,不得像这样使用表格。实际上,它不适用于大多数浏览器。

该问题出现在spree shop中。 spree的内部模板生成错误的URL。因此,修改spree内部模板将协议添加到每个link_to不是解决方案。

在哪里为Rails配置默认协议link_to

Rails link_to generates a link with http:// prfeix. But site is https.

So forms must not be used like so. And actually it is not working for most browsers.

The problem appears in spree shop. Internal templates of spree generates wrong urls. So modify spree internal templates to add protocol to each link_to is not a solution.

Where default protocol is configured for rails link_to?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗失的美好 2025-02-13 17:39:38

您需要传递:stolopt => URL创建中的“ HTTPS”

<%= link_to "text", your_url(:protocol => "https"), :method => :post %>

You need to pass :protocol => 'https' inside the url creation.

<%= link_to "text", your_url(:protocol => "https"), :method => :post %>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文