To Documents
Rails Folders
- This document contains short descriptions of the folders created
by the rails commands.
app
Contains folders for files making up the core of the Rails application.
assets
Contains folders for images, javascripts, an stylesheets that are used for
the project.
controllers
Contains Ruby server-side scripts that orchestrate and control the
application logic.
helpers
Defines helper methods that may be used in multiple places in the
application.
models
Contains scripts and databases that contain the data of the application,
and scripts for moving the data to and from the controller and views.
views
Contains the .html.erb files that define the HTML pages that are displayed
by the browser. It also contains layout files.
config
Contains files that define database configurations, URL routing rules,
and Rails environments for development, testing, and deployment.
db
Scripts for managing relational database tables. The project database
itself is also included in this folder.
doc
Contains documentation generated by RubyDoc. See
www.ruby-doc.org for more details.
lib
Holds code that doesn't fit neatly into any of the model, view, or
controller classifications. The tasks folder contains Rake tasks
for the application.
log
Contains collected log data, including errors and information about
how requests are processed.
public
Contains stylesheets, images, JavaScript scripts, and error pages
like the 404 Not Found page.
script
The home for the prebuilt code that is used for generating, running,
and otherwise interacting with the Rails application.
test
Contains code for testing a Rails application.
tmp
Rails' location for session variables, temporary files, cached data, etc.
vendor
Houses third party plug-ins and gems from outside of Rails. If the
application has been frozen into a particular version of Rails, that
version is stored here.
- Reference: Laurent and Dumbill, Learning Rails,
O'Reilly, 2009, p. 19.