Class: Editarea::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/editarea/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_jsObject



8
9
10
11
12
13
14
15
16
# File 'lib/generators/editarea/install_generator.rb', line 8

def add_js 
  js_manifest = 'app/assets/javascripts/application.js'

  if File.exist?(js_manifest)
    insert_into_file js_manifest, "//= require edit_area_full\n", :after => "jquery_ujs\n"
  else
    copy_file "application.js", js_manifest
  end
end

#copy_assetsObject



19
20
21
# File 'lib/generators/editarea/install_generator.rb', line 19

def copy_assets 
  directory File.expand_path("../../../../vendor/assets", __FILE__), "public/assets"
end