提交 63f094bf 编写于 作者: O Oscar Del Ben

[Guides] Update rails commands section

上级 ba55dd59
......@@ -187,6 +187,8 @@ h4. +rails/commands.rb+
Once +config/boot.rb+ has finished, the next file that is required is +rails/commands+ which will execute a command based on the arguments passed in. In this case, the +ARGV+ array simply contains +server+ which is extracted into the +command+ variable using these lines:
<ruby>
ARGV << '--help' if ARGV.empty?
aliases = {
"g" => "generate",
"c" => "console",
......@@ -199,6 +201,9 @@ command = ARGV.shift
command = aliases[command] || command
</ruby>
TIP: As you can see, an empty ARGV list will make Rails show the help
snippet.
If we used <tt>s</tt> rather than +server+, Rails will use the +aliases+ defined in the file and match them to their respective commands. With the +server+ command, Rails will run this code:
<ruby>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册