Following Drew Neil's Sencha Touch example from SenchaCon 2011, I set out to create a basic Rails 3.1 application w/ an Ext JS 4 (MVC) front-end.
As Drew suggested, I structured the application like this.
All of the Ext JS code is written in CoffeeScript and managed by Rails' Asset Pipeline -- new in Rails 3.1.
Just in case you're not familiar with Asset Pipeline...
In development mode assets are served as separate files.
But in production mode assets are precompiled/minimized and served as static assets with a fingerprint.
In development mode, life is good -- the helper includes ext.js and app.js. From there, Ext.Loader loads framework & and application classes as needed.
But in production mode, the helper includes ext.js and all application files (minimized with fingerprint). For some reason, Ext.Loader still tries to load classes dynamically, even though they're included in the minimized file. If I disable Ext.Loader, the "requires" properties in my views complain.
Along the same lines, using ext.js in production is probably a bad idea too. It sounds like I need to tie into the assets:precompile task, using Sencha Tools to build the library.
Any other Rails 3.1 users out there?