Browse files

Merge pull request #5 from ichord/master

申请翻译 Configuring Rails Appliactions
  • Loading branch information...
2 parents 6e76595 + d197989 commit ddf51ec1ff488de8fdf982b14a815c6f39566847 @Tassandar committed Apr 7, 2012
Showing with 21 additions and 19 deletions.
  1. +2 −0 README.markdown
  2. +16 −18 source/CN/configuring.textile
  3. +3 −1 source/documents_CN.yaml
@@ -1,6 +1,8 @@
# Ruby on Rails Guides 中文指南
如果你也想为 Ruby on Rails 社区出一份力就从这里开始吧!
## Rails Guides 中文
@@ -1,42 +1,40 @@
-h2. Configuring Rails Applications
+h2. 配置 Rails 应用程序
-This guide covers the configuration and initialization features available to Rails applications. By referring to this guide, you will be able to:
-* Adjust the behavior of your Rails applications
-* Add additional code to be run at application start time
+* 控制Rails应用的行为
+* 添加在程序启动时运行的代码
+h3. 初始化代码的为止
-h3. Locations for Initialization Code
-Rails offers four standard spots to place initialization code:
+Rails 提供四个标准的位置防止初始化代码
* +config/application.rb+
-* Environment-specific configuration files
-* Initializers
-* After-initializers
+* 运行环境相关的配置文件
+* 各初始化文件
+* 初始化后运行文件
-h3. Running Code Before Rails
+h3. 先于Rails运行代码
-In the rare event that your application needs to run some code before Rails itself is loaded, put it above the call to +require 'rails/all'+ in +config/application.rb+.
+有时候你需要在 Rails 加载自己之前运行代码, 将调入代码放在 +config/application.rb+ 文件的 +require 'rails/all'+ 之上.
-h3. Configuring Rails Components
+h3. 配置 Rails 组件
-In general, the work of configuring Rails means configuring the components of Rails, as well as configuring Rails itself. The configuration file +config/application.rb+ and environment-specific configuration files (such as +config/environments/production.rb+) allow you to specify the various settings that you want to pass down to all of the components.
+一般而言, 配置Rails的工作其实就是配置Rails的组件, 就像配置Rails本身一样. 配置文件+config/application.rb+ 和运行环境相关的配置文件(比如 +config/environments/ 可以让你设定一些你想传递给所有组件的设置.
-For example, the default +config/application.rb+ file includes this setting:
+例如, 缺省的 +config/application.rb+ 文件包括这个设置:
config.filter_parameters += [:password]
-This is a setting for Rails itself. If you want to pass settings to individual Rails components, you can do so via the same +config+ object in +config/application.rb+:
+这是给Rails本身的设置. 如果你想向单独的Rails组件传递设置, 你同样可以在+config/application.rb+文件里通过同一个+config+对象做一样的操作.
config.active_record.observers = [:hotel_observer, :review_observer]
-Rails will use that particular setting to configure Active Record.
+Rails 将会使用那些特定的设置来配置Active Record.
h4. Rails General Configuration
@@ -87,7 +87,9 @@
name: Configuring Rails Applications
url: configuring.html
- description: This guide covers the basic configuration settings for a Rails application.
+ work_in_progress: true
+ contributor: ichord
+ description: 这个指南覆盖Rails应用的所有基本配置.
name: Rails Command Line Tools and Rake Tasks
url: command_line.html

0 comments on commit ddf51ec

Please sign in to comment.