Class: Pinnable::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Pinnable::Generators::InstallGenerator
- Defined in:
- lib/generators/pinnable/install/install_generator.rb
Overview
‘rails generate pinnable:install` — drops the config initializer and mounts the engine. Migrations are installed separately via `rails pinnable:install:migrations` (the standard engine task), kept out of here so the schema stays single-sourced.
Instance Method Summary collapse
Instance Method Details
#create_initializer ⇒ Object
11 12 13 |
# File 'lib/generators/pinnable/install/install_generator.rb', line 11 def create_initializer template "pinnable.rb", "config/initializers/pinnable.rb" end |
#mount_engine ⇒ Object
15 16 17 |
# File 'lib/generators/pinnable/install/install_generator.rb', line 15 def mount_engine route 'mount Pinnable::Engine => "/pinnable"' end |
#show_post_install ⇒ Object
19 20 21 22 23 24 |
# File 'lib/generators/pinnable/install/install_generator.rb', line 19 def show_post_install say "" say "Pinnable installed. Two steps left:", :green say " 1. bin/rails pinnable:install:migrations && bin/rails db:migrate" say " 2. Add <%= pinnable_widget %> to your layout, just before </body>." end |