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.
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 ofapplication.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 toapplication.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.