0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Rails】railsコマンド 間違えたときの対処方法

Last updated at Posted at 2025-09-23

間違えたコントローラを作成してしまった時

例)homesコントローラを作成したいのに、topコントローラを作成してしまった

$ rails g controller top

ひとつひとつ作成したファイルを削除するのは時間がかかる。。。

そこで、以下のコマンドで解決できる↓

$ rails destroy controller top

最後に、作成すべきコントローラに対応するコマンドを入力する

$ rails g controller homes top
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?