我正在使用需要使用 https 的支付 gem。
我能否强制该应用仅对这 3-4 个 View 使用 https,而让我的其他 View 使用纯 http?
谢谢!
最佳答案
是的,您可以在 Controller 中使用 force_ssl
方法。请参阅文档 here .
class PagesController < ApplicationController
force_ssl only: [:create, :update]
end
关于ruby-on-rails - 是否可以仅在 RoR3 的特定 View 中强制使用 SSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17536614/