Ruby on Rails controller create / delete command

Controller creation

The command to create a controller is ** rails g controller controller name (plural, lowercase) **

Example: rails g controller posts

If you add the action name after the controller name Routing, actions, and views are created at the same time. ** rails g controller controller name Action 1 Action 2… **

Example: rails g controller posts index new

Controller deleted

The command to delete the controller is ** rails destroy controller controller name **

Example: rails destroy controller posts

** * It is not possible to omit destroy and write d **

Recommended Posts

Ruby on Rails controller create / delete command
[Ruby on Rails] model, controller terminal command
Ruby on Rails model creation / deletion command
[Ruby on Rails] Controller test with RSpec
Ruby on Rails application new creation command
Beginners create portfolio in Ruby on Rails
Ruby on Rails Elementary
Ruby on Rails basics
Ruby On Rails Association
[Ruby on Rails] Post editing function (update, delete)
[Introduction] Try to create a Ruby on Rails application
Ruby on rails learning record -2020.10.03
Portfolio creation Ruby on Rails
Ruby on rails learning record -2020.10.04
[Ruby on Rails] Delete s3 images with Active Strage
[Ruby on Rails] Debug (binding.pry)
Ruby on rails learning record -2020.10.09
Ruby on rails learning record-2020.10.07 ②
Ruby on rails learning record-2020.10.07 ①
Cancel Ruby on Rails migration
Ruby on rails learning record -2020.10.06
(Ruby on Rails6) How to create models and tables
Ruby on Rails validation summary
Ruby on Rails Basic Memorandum
Ruby on Rails record search, create if not find_or_create_by method
Delete all the contents of the list page [Ruby on Rails]
[Ruby on Rails] Read try (: [],: key)
Ruby on Rails variable, constant summary
Installing Ruby + Rails on Ubuntu 18.04 (rbenv)
[Ruby on Rails] Introduced paging function
Basic knowledge of Ruby on Rails
Progate Ruby on Rails5 Looking Back
How to use Ruby on Rails
Ruby on Rails Japanese-English support i18n
(Ruby on Rails6) "Erase" posted content
[Ruby on Rails] CSV output function
Ruby on Rails 6.0 environment construction memo
[Ruby on Rails] Confirmation page creation
Ruby On Rails devise routing conflict
[Ruby on Rails] Comment function implementation
[Ruby on Rails] DM, chat function
[Ruby on Rails] Convenient helper method
[Ruby on Rails] Stop "looping until ..."
Explanation of Ruby on rails for beginners ⑤ ~ Edit and delete database ~
(Ruby on Rails6) Create a function to edit the posted content
Create a large number of records with one command using the Ruby on Rails seeds.rb file
[Ruby on Rails] Introduction of initial data
[Ruby on Rails] Search function (not selected)
[Rails] Addition of Ruby On Rails comment function
[Ruby on Rails] Creating an inquiry form
Ruby on Rails6 Practical Guide cp13 ~ cp15 [Memo]
[Ruby on Rails] View test with RSpec
[Ruby on Rails] 1 model CRUD (Routing Main)
Ruby on Rails installation method [Mac edition]
Ruby on Rails6 Practical Guide cp7 ~ cp9 [Memo]
Ruby on Rails in Visual Studio Codespaces
Notes on using FCM with Ruby on Rails
Deploy to Heroku [Ruby on Rails] Beginner
[Ruby on Rails] Image slideshow using Skippr
Preparing to introduce jQuery to Ruby on Rails
[Ruby on Rails] About Active Record callbacks