rails generate controller?rails generate controller Products. Which action is created by default in the generated controller?When you run rails generate controller Products without specifying actions, Rails creates the controller file with no actions inside. You must explicitly list actions to generate them.
index and show actions?Articles with index and show actions.The correct syntax is to list the actions after the controller name separated by spaces. Options like --actions or -a are not valid.
rails generate controller Users new edit?rails generate controller Users new edit, which of the following files is NOT created?The controller generator creates the controller file and view templates for the specified actions. It does not create model files.
rails generate controller Posts show fail with uninitialized constant PostsController error?rails generate controller Posts show but when visiting /posts/show you get uninitialized constant PostsController. What is the most likely cause?uninitialized constant PostsController means Rails cannot find the controller class. This usually happens if the controller file was not created or saved correctly.
--skip-routes when generating a controller?rails generate controller Comments index --skip-routes. What is the effect of the --skip-routes option?By default, Rails adds a route for each generated action. The --skip-routes option prevents this automatic route creation.
