Rails sitemap generator show wrong index

202 views Asked by At

Having a hard time with sitemap_generator.

Finally made it work but now it shows the wrong index of the vacancy pages that I created.

It should include all the vacancies currently online: e.g. http://www.frankfurtstartupjobs.com/vacancies/179

But if you take a look what it actually includes in the sitemap file:

http://www.frankfurtstartupjobs.com/sitemap.xml.gz

It shows vacancies that do not exist (the index is too high): e.g. it shows the vacancy: http://www.frankfurtstartupjobs.com/vacancies/641

Here is my sitemap.rb file:

# Set the host name for URL creation
require 'rubygems'
require 'sitemap_generator'

SitemapGenerator::Sitemap.default_host = "http://www.frankfurtstartupjobs.com"

SitemapGenerator::Sitemap.create do

  Vacancy.find_each do |vacancy|
    add vacancy_path(vacancy), :lastmod => vacancy.updated_at, :priority => 0.5
  end
end

I hope someone can take a look at it and tell me what I miss. Thank you in advance!

0

There are 0 answers