Cấu hình SSL của Ruby on Rails

Michael Gorsuch đăng bài về cách nhanh chóng thiết lập ứng dụng Ruby on Rails của bạn để sử dụng SSL. I was trying to think up the “Ruby Way” to add SSL support to AreYouHiring.com for credit card payments. I surprised myself with this one. Assuming that you already have an SSL cert installed for your app, add the following to your application.rb under app/controllers: def require_ssl redirect_to :protocol => “https://” unless (request.ssl? or local_request?) end Now, we just need to add a before_filter for the actions that need it. I opened up my Job…

Read More