Skip to content

Instantly share code, notes, and snippets.

@tymat
tymat / README.md
Created March 21, 2016 03:12 — forked from timcheadle/README.md
Make /robots.txt aware of the Rails environment

Make /robots.txt aware of the Rails environment

You probably don't want Google crawling your development staging app. Here's how to fix that.

$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt

Now edit config/routes.rb to add a route for /robots.txt, and add the controller code.