Class: Madmin::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Madmin::Generators::InstallGenerator
- Includes:
- Madmin::GeneratorHelpers
- Defined in:
- lib/generators/madmin/install/install_generator.rb
Instance Method Summary collapse
Methods included from Madmin::GeneratorHelpers
Instance Method Details
#generate_resources ⇒ Object
9 10 11 12 13 |
# File 'lib/generators/madmin/install/install_generator.rb', line 9 def generate_resources resources.each do |model| call_generator "madmin:resource", model.to_s end end |
#install_route ⇒ Object
15 16 17 18 19 20 |
# File 'lib/generators/madmin/install/install_generator.rb', line 15 def install_route inject_into_file( Rails.root.join("config/routes.rb"), after: "Rails.application.routes.draw do\n" ) { " namespace :madmin do\n end\n mount Madmin::Engine => \"/madmin\"\n" } end |