Class: ActiveadminBlog::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ActiveadminBlog::Generators::InstallGenerator
- Defined in:
- lib/generators/activeadmin_blog/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_assets ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/generators/activeadmin_blog/install_generator.rb', line 15 def add_assets if File.exist?('app/assets/javascripts/active_admin.js') insert_into_file "app/assets/javascripts/active_admin.js", "//= require activeadmin_blog\n", :after => "base\n" else puts "It doesn't look like you've installed activeadmin: active_admin.js is missing.\nPlease install it and try again." end if File.exist?('app/assets/stylesheets/active_admin.css.scss') insert_into_file "app/assets/stylesheets/active_admin.css.scss", "//= require activeadmin_blog\n", :before => "// Active Admin CSS Styles\n" else puts "It doesn't look like you've installed activeadmin: active_admin.scss is missing.\nPlease install it and try again." end end |
#copy_files ⇒ Object
8 9 10 11 12 13 |
# File 'lib/generators/activeadmin_blog/install_generator.rb', line 8 def copy_files # admin puts "Installing admin:" copy_file "admin/blog_categories.rb", "app/admin/blog_categories.rb" copy_file "admin/blog_posts.rb", "app/admin/blog_posts.rb" end |
#mount_engine ⇒ Object
31 32 33 |
# File 'lib/generators/activeadmin_blog/install_generator.rb', line 31 def mount_engine route "mount_blog_at '/#{file_name}'" end |
#show_congrats ⇒ Object
35 36 37 |
# File 'lib/generators/activeadmin_blog/install_generator.rb', line 35 def show_congrats readme("README") end |