alexrabarts/big_sitemap — Issue #30: 'add' method isn't working properly
Author: urieljuliatti
Created: 2012-02-09 18:23:25+00:00
State: open

It seems that the add method isn't working properly on my application.

After generate the sitemap xml i get some incompatibilities from the generated file compared to my application routes, ex:

It should return:
`
http://www.urieljuliatti.com.br/produto/1-ecailles-de-la-lune
2011-12-05
daily
0.5
`
Instead of:

`
http://www.urieljuliatti.com.br/1-ecailles-de-la-lune
2011-12-05
daily
0.5
`

My routing system returns /produto/1-ecailles-de-la-lune, but the generated sitemap file doesn't include the product controller param. What's going on?

That's my rake task implementation:
`namespace :sitemap do
task :generate, [ :needs ] => [ :environment ] do
require 'big_sitemap'
include Rails.application.routes.url_helpers
include I18n
I18n.locale = :ptBR
BigSitemap.generate(:base_url => Store.default.url, :document_root => "#{Rails.root}/public", :document_full => "#{Rails.root}/public") do
Product.all.each do |product|
add show_product_path(product), :change_frequency => 'daily', :priority => 0.5, :last_modified => product.updated_at
end
Brand.all.each do |brand|
add brand_path(brand), :change_frequency => 'daily', :priority => 0.5, :last_modified => brand.updated_at
end
end
end
end`