diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-05-08 09:22:43 -0500 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-05-17 18:12:19 +0530 |
commit | 63ac6255ba3553b529f4b23846ec756b7a7a746d (patch) | |
tree | 926d54c770f2388352095a94c5267841eb52e26c /activerecord/test/cases/ar_schema_test.rb | |
parent | 1e791705dcea650a034b7ccb4d922f455648202d (diff) | |
download | rails-63ac6255ba3553b529f4b23846ec756b7a7a746d.tar.gz rails-63ac6255ba3553b529f4b23846ec756b7a7a746d.tar.bz2 rails-63ac6255ba3553b529f4b23846ec756b7a7a746d.zip |
Cable: Generate .js or .coffee files while generating channel as per the javascript engine of the application
- Now we will detect what javascript engine user is using and based on
that we will generate either `.js` or `.coffee` version of the channel
file.
- This also needs a change in coffee-rails to override the `js_template`
method. Related PR https://github.com/rails/coffee-rails/pull/72.
- Currently coffee-rails gem sets
`config.app_generators.javascript_engine` to `:coffee` and using this
information we override the `js_template` to set the extension as
`.coffee` in coffee-rails gem.
- Using this approach, we can keep the `channel.js` and `channel.coffee`
files in the Rails repository itself.
- Additionally the `js_template` method can act as public interface for
coffee-rails gem to hook into and change the extension to `.coffee`
without maintaining the actual asset files.
[Prathamesh Sonpatki, Matthew Draper]
Diffstat (limited to 'activerecord/test/cases/ar_schema_test.rb')
0 files changed, 0 insertions, 0 deletions