module ActionController::ForceSSL::ClassMethods

def force_ssl(options = {})

callback will be called only when it returns a false value.
* unless - A symbol naming an instance method or a proc; the
callback will be called only when it returns a true value.
* if - A symbol naming an instance method or a proc; the
* except - The callback should be run for all actions except this action
* only - The callback should be run only for this action
You can pass any of the following options to affect the before_action callback
==== Action Options

* notice - Set a notice message when redirecting
* alert - Set an alert message when redirecting
* flash - Set a flash message when redirecting
* status - Redirect with a custom status (default is 301 Moved Permanently)
You can pass any of the following options to affect the redirect status and response
==== Redirect Options

* path - Redirect to a different path
* port - Redirect to a non-standard port
* domain - Redirect to a different domain
* subdomain - Redirect to a different subdomain
* host - Redirect to a different host name
You can pass any of the following options to affect the redirect url
==== URL Options

end
end
!Rails.env.development?
def ssl_configured?

force_ssl if: :ssl_configured?
class AccountsController < ApplicationController

an +:if+ or +:unless+ condition.
If you need to disable this for any reason (e.g. development) then you can use

under HTTPS protocol.
Force the request to this particular controller or specified actions to be
def force_ssl(options = {})
  action_options = options.slice(*ACTION_OPTIONS)
  redirect_options = options.except(*ACTION_OPTIONS)
  before_action(action_options) do
    force_ssl_redirect(redirect_options)
  end
end