sinisterchipmunk / jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
http://jaxgl.com
MIT License
96 stars 16 forks source link

jax/application.js should be generated for applications #49

Closed sinisterchipmunk closed 12 years ago

sinisterchipmunk commented 12 years ago

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.

sinisterchipmunk commented 12 years ago

Implemented, see d4182c1bee279dc094c87b4bcd254133ee0d1d5a.