Class: Solidstats::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Solidstats::Generators::InstallGenerator
- Defined in:
- lib/generators/solidstats/install/install_generator.rb
Overview
This generator installs Solidstats routes in the host application
This will:
-
Add the Solidstats routes to the host application’s config/routes.rb
-
Show a helpful README with next steps
Instance Method Summary collapse
Instance Method Details
#add_routes ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/generators/solidstats/install/install_generator.rb', line 17 def add_routes route_code = <<-RUBY # Solidstats Routes (development only) mount Solidstats::Engine => "/solidstats" if Rails.env.development? RUBY route route_code say_status :routes, "Mounting Solidstats engine at /solidstats (development environment only)", :green end |
#show_readme ⇒ Object
27 28 29 |
# File 'lib/generators/solidstats/install/install_generator.rb', line 27 def show_readme readme "README" if behavior == :invoke end |