Decides whether to use TLS encryption or not on a per-environment basis in Rails. Inspired by this discussion.
gem install protocool
# In development mode:
Protocool.https # => 'http'
# In any other environment:
Protocool.https # => 'https'
In your routes:
scope constraints: { protocol: Protocool.protocol } do
# ...
end