If I run rails generate controller ControllerName I get an empty controller? I can manually edit it to what I want but why does this seem to happen? Is it not suppose to put the 7 default in there if I leave the options blank?
If I run rails generate controller ControllerName I get an empty controller? I can
Share
That’s the default behavior for the controller generator. If you want the default actions, you will want to use
rails generate scaffold.Note that you can also pass the names of actions to the controller generator to generate blank actions. This takes care of setting up basic tests/views/etc, but you will need to write your own code for each action you define this way: