我正试图让dynamic_sitemaps gem与我的网站一起工作,但是自述文件非常技术性,目前有点超出我的考虑。
在试图为这段代码生成站点地图时,我遇到了一些错误。
# You can have multiple sitemaps like the above – just make sure their names are different.
# Automatically link to all pages using the routes specified
# using "resources :pages" in config/routes.rb. This will also
# automatically set <lastmod> to the date and time in page.updated_at:
#
sitemap_for :offers
它正在返回以下错误
ArgumentError:提供给
sitemap_for
的集合必须响应find_each。这是为了表演。使用Model.scoped
获取响应find_each的ActiveRecord关系。
我希望有网站地图,包括我的所有优惠职位,等等。
任何帮助都是非常感谢的!
发布于 2015-10-10 13:35:21
如果你的模特的名字是提供的,试试
sitemap_for Offer.all
(注:#作用域已不再推荐,因此#all似乎是今后更好的选择)
https://stackoverflow.com/questions/33053873
复制相似问题