Class: Databound::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Databound::Generators::InstallGenerator
- Defined in:
- lib/generators/databound/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_assets ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/databound/install/install_generator.rb', line 9 def add_assets js_manifest = 'app/assets/javascripts/application.js' coffee_manifest = 'app/assets/javascripts/application.js.coffee' if File.exist?(js_manifest) insert_into_file js_manifest, "//= require databound\n", after: "jquery_ujs\n" elsif File.exist?(coffee_manifest) insert_into_file coffee_manifest, "#= require databound\n", after: "jquery_ujs\n" else copy_file 'application.js', js_manifest end end |
#add_databound ⇒ Object
22 23 24 |
# File 'lib/generators/databound/install/install_generator.rb', line 22 def add_databound copy_file 'databound-standalone.js', 'vendor/assets/javascripts/databound.js' end |