diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-06-27 21:54:03 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-06-29 21:16:09 -0300 |
commit | 539752a54cf3426c98e65136206df9f9553d9e73 (patch) | |
tree | a76ec8d991538f82823a715ad3fcc49d0e470c9c /railties/lib/rails/generators/js | |
parent | 4d256bc6b1e6ae62c78d0ff3ca17480a53e00436 (diff) | |
download | rails-539752a54cf3426c98e65136206df9f9553d9e73.tar.gz rails-539752a54cf3426c98e65136206df9f9553d9e73.tar.bz2 rails-539752a54cf3426c98e65136206df9f9553d9e73.zip |
Move Coffee generators and templates to Coffee Railtie and create javascript_engine ("js") for apps that remove Coffee gem
Diffstat (limited to 'railties/lib/rails/generators/js')
-rw-r--r-- | railties/lib/rails/generators/js/assets/assets_generator.rb | 13 | ||||
-rw-r--r-- | railties/lib/rails/generators/js/assets/templates/javascript.js | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/js/assets/assets_generator.rb b/railties/lib/rails/generators/js/assets/assets_generator.rb new file mode 100644 index 0000000000..d134a9e392 --- /dev/null +++ b/railties/lib/rails/generators/js/assets/assets_generator.rb @@ -0,0 +1,13 @@ +require "rails/generators/named_base" + +module Js + module Generators + class AssetsGenerator < Rails::Generators::NamedBase + source_root File.expand_path("../templates", __FILE__) + + def copy_javascript + copy_file "javascript.js", File.join('app/assets/javascripts', class_path, "#{file_name}.js") + end + end + end +end diff --git a/railties/lib/rails/generators/js/assets/templates/javascript.js b/railties/lib/rails/generators/js/assets/templates/javascript.js new file mode 100644 index 0000000000..dee720facd --- /dev/null +++ b/railties/lib/rails/generators/js/assets/templates/javascript.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. |