Browse files

[Guides] Update rails commands section

  • Loading branch information...
1 parent ba55dd5 commit 63f094bf2984127132589f5c93e6dabcad898b12 @oscardelben oscardelben committed May 22, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 guides/source/initialization.textile
@@ -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:
+ARGV << '--help' if ARGV.empty?
aliases = {
"g" => "generate",
"c" => "console",
@@ -199,6 +201,9 @@ command = ARGV.shift
command = aliases[command] || command
+TIP: As you can see, an empty ARGV list will make Rails show the help
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:

0 comments on commit 63f094b

Please sign in to comment.