Class: ActiveAdmin::Generators::AssetsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/active_admin/assets/assets_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



5
6
7
# File 'lib/generators/active_admin/assets/assets_generator.rb', line 5

def self.source_root
  @_active_admin_source_root ||= File.expand_path("../templates", __FILE__)
end

Instance Method Details

#install_assetsObject



9
10
11
12
13
14
15
16
17
# File 'lib/generators/active_admin/assets/assets_generator.rb', line 9

def install_assets
  if ActiveAdmin.use_asset_pipeline?
    template '3.1/active_admin.js', 'app/assets/javascripts/active_admin.js'
    template '3.1/active_admin.css.scss', 'app/assets/stylesheets/active_admin.css.scss'
  else
    template '3.0/active_admin.js', 'public/javascripts/active_admin.js'
    directory '../../../../../app/assets/images/active_admin', 'public/images/active_admin'
  end
end