こんにちは。現在railsでsitemapをプログラムしております。
サイトマップにて、クローリングで読み込んで貰うためのプログラムを書き込みたいのですが、そのプログラム方法についての質問です。
1:多でプログラムを構築しているeatery:reviewsがございます。このreviews先の各idをgoogleに送りたいのですが、プログラムの仕方がわからず困っております。
現在は以下のように表記しております。よろしくお願い致します。
add reviews_path, :priority => 1.0, :changefreq => 'daily' Review.find_each do |review| add eatery_review_path(review.eatery.id, review.id), :lastmod => review.updated_at end
route
1 resources :eateries do 2 collection do 3 post :import 4 end 5 resources :reviews, except: [:index] 6 end
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:pagemap="http://www.google.com/schemas/sitemap-pagemap/1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>http://www.example.com</loc><lastmod>2020-05-13T13:59:41+09:00</lastmod><changefreq>always</changefreq><priority>1.0</priority></url></urlset>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/09/10 06:21
2021/09/10 06:27
2021/09/10 08:03
2021/09/10 09:31
2021/09/11 02:38
2021/09/15 04:40