Module: ForceHttp::ClassMethods
- Defined in:
- lib/force_http.rb
Instance Method Summary collapse
Instance Method Details
#force_http(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/force_http.rb', line 10 def force_http( = {}) host = .delete(:host) before_filter() do if request.ssl? && !Rails.env.development? = {:protocol => 'http://', :status => :moved_permanently} .merge!(:host => host) if host .merge!(:params => request.query_parameters) redirect_to end end end |