Sha256: 90b4c06110522ed05ebc4d6bd084d8d97d32099117176553fed3f807c6210415

Contents?: true

Size: 364 Bytes

Versions: 11

Compression:

Stored size: 364 Bytes

Contents

module RailsSitemap
  module ActAsSitemap
    extend ActiveSupport::Concern

    included do
      before_action :set_current_domain

      protected

      def set_current_domain
        uri = URI.parse(request.original_url)
        pre_html = uri.html_safe? ? 'https://' : 'http://'

        @current_domain = pre_html + uri.hostname
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails_sitemap-0.3.3 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.3.2 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.3.1 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.3.0 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.2.5 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.2.4 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.2.3 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.2.2 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.2.1 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.2.0 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb
rails_sitemap-0.1.0 app/controllers/concerns/rails_sitemap/act_as_sitemap.rb