Class: ActiveadminAddons::Generators::WebpackerGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveadminAddons::Generators::WebpackerGenerator
- Defined in:
- lib/generators/activeadmin_addons/webpacker/webpacker_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_javascripts ⇒ Object
4 5 6 7 8 9 |
# File 'lib/generators/activeadmin_addons/webpacker/webpacker_generator.rb', line 4 def add_javascripts file_path = 'app/javascript/packs/active_admin.js' reference = "import \"@activeadmin/activeadmin\";\n" inject_into_file(file_path, js_assets, after: reference) end |
#add_stylesheets ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/generators/activeadmin_addons/webpacker/webpacker_generator.rb', line 11 def add_stylesheets file_path = 'app/javascript/stylesheets/active_admin.scss' begin prepend_file(file_path, css_assets) end end |
#install_package ⇒ Object
19 20 21 |
# File 'lib/generators/activeadmin_addons/webpacker/webpacker_generator.rb', line 19 def install_package run "yarn add activeadmin_addons" end |