【问题标题】:Convert url from https to http [closed]将 url 从 https 转换为 http [关闭]
【发布时间】:2017-11-30 07:33:51
【问题描述】:

我有一个默认使用 https 的网址:

url = article_url(@article)

我想要相同的 url 但使用 http,而不是使用 https

【问题讨论】:

标签: ruby-on-rails


【解决方案1】:

我正在寻找的正确答案是: https://apidock.com/rails/ActionController/Base/url_for

url_for(controller: 'articles', action: 'show', id: @article.id, protocol: :http)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-30
    • 2021-08-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多