You can use the same structure as a project with requirejs with the rails asset pipeline. Using a file just for models, collections and etc depends a lot on the size of your project. Example structure:
javascripts
├── app
│ ├── collections
│ │ ├── ingredients.js
│ │ ├── recipes.js
│ │ └── users.js
│ ├── mediator.js
│ ├── models
│ │ ├── ingredient.js
│ │ ├── recipe.js
│ │ ├── signup.js
│ │ └── user.js
│ ├── router.js
│ └── views
│ ├── _ingredient.js
│ ├── _recipe.js
│ ├── admin.js
│ ├── base_modal.js
│ ├── signup.js
│ ├── topbar.js
│ ├── user.js
└── vendor
├── backbone-0.9.2.js
├── backbone.localStorage-min.js
├── handlebars.js
├── jquery.js
└── underscore.js
In Rails, the difference is that you will make the require's of the files in a sprockets file (the application.js by default). Remember that in Rails the javascripts
directory starts after app/assets/
.