I\'m working on a hobby app and using some jQuery. The results are fine at the moment, but I\'m a jQuery noob and I assume that there are some significant improvements that I ca
1) Compilation: Rails assets pipeline just combines all javascript files in one big file.
2) jquery is only loaded once, you are having multiple $(document).ready
functions, but that is not a problem
3) Rails does not do anything with the call, and jQuery can safely handle more of those blocks per page.
4) You call it a model-specific .js
, I would rather call it controller-specific. You group functionality together that belongs together. Whether the thing that ties them together is a controller or a model really does not matter. We split our js up in separate files to make it more manageable.
5) In development the assets are compiled on every request, in production it is done only once. Also in production it could be minified and compressed.
Hope this helps.