开发者

Determine if current page is using SSL in Rails

I'm trying to detect if the current page is being delivered via SSL in order to decide whethe开发者_运维技巧r or not to include certain unsecure external resources. My current method involves checking if request.url starts with 'https'. Is this the simplest way of accomplishing this? Is there a better way? Thanks!


In a controller or view:

request.ssl?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜