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.

Code:
app/
  models/
  views/
  controllers/
  assets/
    javascripts/
      app/
        controllers/
        models/
        stores/
        views/

vendor/
  assets/
    javascripts/
      ext-4.0.7/
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...

<%= javascript_include_tag "application" %>

In development mode assets are served as separate files.

Code:
<script src="/assets/app/app.js?body=1" type="text/javascript"></script>
<script src="/assets/app/MyController.js?body=1" type="text/javascript"></script>
<script src="/assets/app/MyView.js?body=1" type="text/javascript"></script>
But in production mode assets are precompiled/minimized and served as static assets with a fingerprint.

Code:
<script src="/assets/application-908e25f4bf641868d8683022a5b62f54.js" type="text/javascript"></script>
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?

Thanks!