在安裝好 ROR 時我們會碰到的就是基本的rails mvc目錄結構,以下引用官網,加上自己的翻譯!!!!!
File/Folder | Purpose |
---|---|
app/ |
Contains the controllers, models, views, helpers, mailers and assets for your application. You'll focus on this folder for the remainder of this guide. 這個目錄包含了 controllers, models, views, helpers, mailers assets 六大目錄! |
bin/ |
Contains the rails script that starts your app and can contain other scripts you use to deploy or run your application. 這個目錄包含了,rails script啟動你的應用程式,以及可以讓你自己放SCRIPT! |
config/ |
Configure your application's routes, database, and more. This is covered in more detail in Configuring Rails Applications. 此目錄包含你的路俓設定,DB設定..等等. 更詳細的,請參考----------------------------------------------^ |
config.ru |
Rack configuration for Rack based servers used to start the application. 用來啟動應用程式的RACK伺服器設定檔 |
db/ |
Contains your current database schema, as well as the database migrations. 包含資料庫的架構, 還有建好的資料庫轉移資料... |
Gemfile Gemfile.lock |
These files allow you to specify what gem dependencies are needed for your Rails application. These files are used by the Bundler gem. For more information about Bundler, see the Bundler website. 套件存放區,像PHP的Vendor |
lib/ |
Extended modules for your application. 放modules囉 |
log/ |
Application log files. 記錄 |
public/ |
The only folder seen by the world as-is. Contains static files and compiled assets. 就像共用的,或是CSS,JS等等檔案 |
Rakefile | This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application. |
README.rdoc |
This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on. 說明檔 |
test/ |
Unit tests, fixtures, and other test apparatus. These are covered in Testing Rails Applications. 單元測試或整合測試... |
tmp/ |
Temporary files (like cache, pid, and session files). CACHE或者SESSION檔案放置的地方, |
vendor/ |
A place for all third-party code. In a typical Rails application this includes vendored gems. 第三方套件存放區 |
剛又發現中文網站,可以參考這裡