I want to generate a sitemap of a website with more than 300 URL path. Therefore using a sitemap generator, I am fetching URL path from routes.rb file. Now I don't want SEO to crawl through my post url. So, I wanted to determine the Http-method type of controller paths in sitemap.rb. How to do that?
I have tried to fetch http-method with route.path.spec.left.memo.request_method_match, but NoMethodError occue.
Request method is also called
verb, so you can do following:Different version of rails might have it slightly different, but once you have your route look for
verb. (check documentation: https://www.rubydoc.info/docs/rails/4.1.7/ActionDispatch/Journey/Route)I think this gives you enough info to continue.