Class: Administrate::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Administrate::Generators::InstallGenerator
- Includes:
- Administrate::GeneratorHelpers
- Defined in:
- lib/generators/administrate/install/install_generator.rb
Instance Method Summary collapse
- #create_dashboard_controller ⇒ Object
- #run_dashboard_generators ⇒ Object
- #run_routes_generator ⇒ Object
Methods included from Administrate::GeneratorHelpers
Instance Method Details
#create_dashboard_controller ⇒ Object
20 21 22 23 24 25 |
# File 'lib/generators/administrate/install/install_generator.rb', line 20 def create_dashboard_controller template( "application_controller.rb.erb", "app/controllers/#{namespace}/application_controller.rb", ) end |
#run_dashboard_generators ⇒ Object
27 28 29 30 31 32 |
# File 'lib/generators/administrate/install/install_generator.rb', line 27 def run_dashboard_generators singular_dashboard_resources.each do |resource| call_generator "administrate:dashboard", resource, "--namespace", namespace end end |
#run_routes_generator ⇒ Object
13 14 15 16 17 18 |
# File 'lib/generators/administrate/install/install_generator.rb', line 13 def run_routes_generator if dashboard_resources.none? call_generator("administrate:routes", "--namespace", namespace) load Rails.root.join("config/routes.rb") end end |