Topic: Rails with SSL certificate using SslRequirement plugin

Hi all,

I need to put a certificate SSL in my site.

I saw that exists a plugin called SslRequirement but i don't know how it works.

Someone has a complete example with this plugin in rails? Rails can do it by himself or needs apache to do it.


Re: Rails with SSL certificate using SslRequirement plugin

Been a while since I used that plugin, but I think after you install it you just add something like this to the controller or controllers that have actions that need SSL

class StoreController < ApplicationController
  ssl_required :checkout, :pre_checkout, :pay_with_card, :place_order
  ssl_allowed :place_express_order, :thank_you, :index

any actions that need ssl are listed after ssl_required, that way it automatically changes the url to https when someone goes to those actions.

If there are any actions if it doesn't matter if they use ssl place them after ssl_allowed and if someone navigates there using https it will stay https or if they get there using http it will stay http.

All other actions will redirect to http if someone gets there with https.