Class: Bootstrap::Tooltip::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_assetsObject



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

def add_assets
  if File.exist?("app/assets/javascripts/application.js")
    insert_into_file "app/assets/javascripts/application.js", "//= require bootstrap/bootstrap-tooltip\n", :after => "jquery_ujs\n"
  end

  if File.exist?("app/assets/stylesheets/application.css")
    insert_into_file "app/assets/stylesheets/application.css", " *= require bootstrap/bootstrap-tooltip\n", :after => "require_self\n"
  end
end