Is it a bad idea do divide the models into directories?

后端 未结 2 1007
天命终不由人
天命终不由人 2021-01-30 04:34

I have a over 100 models in my rails application, and just for organization, I\'m dividing them into folders, all still under the main model folder, just to make it simpler to n

2条回答
  •  攒了一身酷
    2021-01-30 04:49

    For 100 models, it's practically a requirement. 100 models is noisy in one directory.

    Try this to get an idea of the Rails Way (tm)

    rails new MultiDirectoryExample
    cd MultiDirectoryExample
    rails generate scaffold User::Photo description:string
    

    Watch the script output and view the generated files.

提交回复
热议问题