There are many useful rails generate commands. I’ve listed some of them below for your reference:
1234567891011121314151617181920
# Creates a model and controller, then adds a resource route to your routes.rb file.railsgresource<attribute>:<type><attribute>:<type># Just like rails g scaffold, but doesn't create the model.railsgscaffold_controller<name># Creates a coffeescript/javascript and corresponding (s)css file.railsgassets<name># Creates a jbuilder filerailsgjbuilder<name><field>:<type><field>:<type># Creates a custom helper.railsghelper<name># Allows you to create your own custom generates to be used with rails generate.railsggenerator<name># Creates a rake task.railsg<namespace><task_name><task_name>
For a complete list of all generate commands, simply run rails g or rails generate from within a project.