lib/rails_ext/action_controller/micelaneous.rb in rails-ext-0.3.19 vs lib/rails_ext/action_controller/micelaneous.rb in rails-ext-0.3.20

- old
+ new

@@ -89,14 +89,14 @@ # # enshure domain has www. except if there's custom subdomain # def ensure_www - # if request.domain.count('.') < 2 and Rails.production? and request.domain !~ /localhost/ - # uri = Addressable::URI.parse request.url - # uri.host = "www." + uri.host - # redirect_to uri.to_s - # end + uri = Addressable::URI.parse request.url + if uri.host.count('.') < 2 and Rails.production? and request.domain !~ /localhost/ + uri.host = "www." + uri.host + redirect_to uri.to_s + end end class << self def prepare_model aclass, opt = {} \ No newline at end of file