From 9fd954d2856f3c385299ba34d0af3ddd3b66c748 Mon Sep 17 00:00:00 2001 From: Guillaume Lazzara Date: Thu, 7 Jul 2016 10:13:46 +0200 Subject: [PATCH] Add default protocol for urls --- app/controllers/application_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3de8f05f0..94730501d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,5 +3,8 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception - + def default_url_options + return { protocol: 'https' } if Rails.env.staging? || Rails.env.production? + {} + end end