generating sitemaps how do i make xml.url and xml.loc return https instead of http

5 views
Skip to first unread message

fugee ohu

unread,
Oct 8, 2018, 2:55:46 PM10/8/18
to Ruby on Rails: Talk
   base_url = "https://#{request.host_with_port}/"

   xml.url do
      xml.loc base_url
      xml.changefreq "monthly"
      xml.priority 0.3
   end

  @people.each do |person|
    xml.url do
      xml.loc base_url+'person_url(person)
      xml.lastmod person.updated_at.to_date.to_s(:db)
      xml.changefreq "monthly"
      xml.priority 0.3
    end
  end
  

Reply all
Reply to author
Forward
0 new messages