Created
February 29, 2012 13:59
-
-
Save brandon-beacher/1941046 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# an module to redirect a controller to http from https | |
# drop this in lib/httpable.rb | |
module Httpable | |
def self.included(base) | |
base.send :include, InstanceMethods | |
base.before_filter :redirect_to_http | |
end | |
module InstanceMethods | |
private | |
def redirect_to_http | |
redirect_to :protocol => "http" if request.ssl? | |
end | |
end | |
end | |
# include this module into controllers which should redirect to http | |
class PagesController < ApplicationController | |
include Httpable | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment