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
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