sinisterchipmunk/jax — Issue #49: jax/application.js should be generated for applications
Author: sinisterchipmunk
Created: 2011-12-18 16:38:53+00:00
State: open
Labels: enhancement

Currently `jax/application.js` is stored within Jax itself. The user may need to customize this file, for instance to add an "admin" area that should not be generated for non-admin users.

Currently, it is possible to simply add the file to `app/assets/javascripts/jax/application.js`, but this is not documented anywhere. Additionally, the developer would have to open the Jax source code and manually copy the contents of `application.js`, which is unacceptable.

Generating this file automatically has other fringe benefits. Instead of relying on custom matchers like `require_everything_matching "controllers"`, Jax could append paths to `application.js` upon generating the models, controllers, etc. This might allow the Jax directive processor to be removed entirely, falling back to the standard (and probably more robust) Sprockets directive processor.

One last benefit is that it becomes very plain to the user which JavaScript file needs to be included into Rails applications to make their app work, and that they can rename or copy this file as needed, providing much greater flexibility for highly dynamic applications.