mirror of https://github.com/CrimsonTome/tldr.git
25 lines
551 B
Markdown
25 lines
551 B
Markdown
|
# rails destroy
|
||
|
|
||
|
> Menghapus Rails _resources_.
|
||
|
> Informasi lebih lanjut: <https://guides.rubyonrails.org/command_line.html#bin-rails-destroy>.
|
||
|
|
||
|
- Menampilkan daftar semua generator yang tersedia untuk menghapus:
|
||
|
|
||
|
`rails destroy`
|
||
|
|
||
|
- Menghapus model yang bernama Post:
|
||
|
|
||
|
`rails destroy model {{Post}}`
|
||
|
|
||
|
- Menghapus _controller_ yang bernama Post:
|
||
|
|
||
|
`rails destroy controller {{Posts}}`
|
||
|
|
||
|
- Menghapus migrasi yang membuat Posts:
|
||
|
|
||
|
`rails destroy migration {{CreatePosts}}`
|
||
|
|
||
|
- Menghapus _scaffold_ model yang bernama Post:
|
||
|
|
||
|
`rails destroy scaffold {{Post}}`
|