0

what should i add to sitemap to correctly working? I using gem 'sitemap_generator' . It is a good idea to using gem ?

sitemap.rb

SitemapGenerator::Sitemap.default_host = "http://localhost:3000"
SitemapGenerator::Sitemap.adapter = SitemapGenerator::WaveAdapter.new

SitemapGenerator::Sitemap.create do

  add root_path
  add news_index_path, changefreq: 'weekly'
  add castings_path
  add premium_path

  News.find_each do |news|
    add news_index_path(news), :lastmod => news.updated_at
  end

end
  • 1) What is not working? 2) Default host is for testing hopefully? 3) Good read over here btw maybe duplicate http://stackoverflow.com/questions/2077266/google-sitemap-files-for-rails-projects?rq=1 (PS: Also using https://github.com/kjvarga/sitemap_generator and I don't see any disadvantages) – everyman Sep 20 '16 at 08:19
  • News.find_each do - don't work – Vladyslav Kalyuzhnyy Sep 20 '16 at 08:28
  • I bet you have problems with the model name (Plural...) Check this one http://stackoverflow.com/a/8524566/1257369 (ActiveSupport::Inflector) – everyman Sep 20 '16 at 08:51

0 Answers0