I\'m looking to learn how to cleanup my app\'s URLs. My app is powered by Rails 3 on Heroku.
The desired URL is https://www.example.comite.com
I
Rails 3.1.0 and higher has force_ssl, which is a controller method that will redirect to https for non-development environments.
http://api.rubyonrails.org/classes/ActionController/ForceSSL/ClassMethods.html
Place it in each controller that you want to redirect, or better yet, place it in your ApplicationController:
app/controllers/application.rb:
class ApplicationController < ActionController::Base
# ...
force_ssl
# ...
end
This is a good thing to always include in your apps (and of course you'll have to get a certificate). HTTPS Everywhere!