$ rails generate model Category name:string
$ rake db:migrate
$ rails generate model Subcategory name:string
rake db:migrate

Subcategory