Rails Cleanup

by Daniel Kehoe

Last updated 1 March 2012

This is a guide for developers using the example apps from the Rails Apps repository. Others may find it helpful as well.

Background

Several unneeded files are generated in the process of creating a new Rails application.

Additionally, you may want to prevent search engines from indexing your website (“ban spiders”) if you’ve deployed it publicly while still in development.

Remove Unneeded Files

If you are creating an application template, this step uses the cleanup recipe from the rails_apps_composer repository.

Remove various unneeded files from your application:

In Rails 3.1 and newer:

$ rm app/assets/images/rails.png

Delete public/index.html

To run and test your application, you likely already deleted the default home page from your application. But if you didn’t already:

$ rm public/index.html

Ban Spiders

If you are creating an application template, this step uses the extras recipe from the rails_apps_composer repository.

You may want to modify the file public/robots.txt to prevent indexing by search engines if you plan to have a development version on a publicly accessible server:

# To ban all spiders from the entire site uncomment the next two lines:
User-Agent: *
Disallow: /

Comments

Is this helpful? Your encouragement fuels the project. Please tweet or add a comment. Couldn't get something to work? For the example apps and tutorials, it's best to open an issue on GitHub so we can help you.

comments powered by Disqus