lib/action_controller/metal/force_ssl.rb
# Force the request to this particular controller or specified actions to be
# under HTTPS protocol.
#
# Note that this method will not be effective on development environment.
#
# ==== Options
# * <tt>only</tt>   - The callback should be run only for this action
# * <tt>except<tt>  - The callback should be run for all actions except this action
Force the request to this particular controller or specified actions to be
under HTTPS protocol.

Note that this method will not be effective on development environment.

Options
only   - The callback should be run only for this action
except  - The callback should be run for all actions except this action
Force the request to this particular controller or specified actions to be under HTTPS protocol . Note that this method will not be effective on development environment . Options only - The callback should be run only for this action except - The callback should be run for all actions except this action
def force_ssl(options = {})
        before_filter(options) do
          if !request.ssl? && !Rails.env.development?
            redirect_to :protocol => 'https://', :status => :moved_permanently
          end
        end
      end
def force_ssl ( options = { } ) before_filter ( options ) do if ! request . ssl? && ! Rails . env . development? redirect_to :protocol => 'https://' , :status => :moved_permanently end end end
Force the request to this particular controller or specified actions to be
under HTTPS protocol.
Force the request to this particular controller or specified actions to be under HTTPS protocol .
options