Skip to content

Commit

Permalink
Add Destroy Alias
Browse files Browse the repository at this point in the history
* Added destroy alias to rails generator

* add alias info for destroy command

* Updated command line guides
  • Loading branch information
ognevsky committed Aug 22, 2011
1 parent aae5ebf commit 44f0d94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions railties/guides/source/command_line.textile
Expand Up @@ -325,6 +325,8 @@ h4. +rails destroy+

Think of +destroy+ as the opposite of +generate+. It'll figure out what generate did, and undo it.

You can also use the alias "d" to invoke the destroy command: <tt>rails d</tt>.

<shell>
$ rails generate model Oops
exists app/models/
Expand Down
3 changes: 2 additions & 1 deletion railties/lib/rails/commands.rb
Expand Up @@ -4,6 +4,7 @@

aliases = {
"g" => "generate",
"d" => "destroy",
"c" => "console",
"s" => "server",
"db" => "dbconsole",
Expand Down Expand Up @@ -87,7 +88,7 @@
In addition to those, there are:
application Generate the Rails application code
destroy Undo code generated with "generate"
destroy Undo code generated with "generate" (short-cut alias: "d")
benchmarker See how fast a piece of code runs
profiler Get profile information from a piece of code
plugin Install a plugin
Expand Down

0 comments on commit 44f0d94

Please sign in to comment.