Class: Webring::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/webring/install/install_generator.rb

Overview

Note:

You can change the mount path in your routes.rb file after installation

It mounts the Webring engine to your Rails application’s routes

Examples:

After installation, the engine will be mounted at /webring

# In your routes.rb
mount Webring::Engine => '/webring', as: 'webring'

Instance Method Summary collapse

Instance Method Details

#add_webring_routesObject

Adds the engine mount point and widget route to the application’s routes.rb file



19
20
21
22
# File 'lib/generators/webring/install/install_generator.rb', line 19

def add_webring_routes
  route "scope module: 'webring' do\n  get 'widget.js', to: 'widget#show', format: 'js', as: :widget\nend\n\n"
  route "mount Webring::Engine => '/webring', as: 'webring'\n\n"
end

#show_readmeObject

Displays the README with next steps after installation



25
26
27
# File 'lib/generators/webring/install/install_generator.rb', line 25

def show_readme
  readme 'AFTER_INSTALL' if behavior == :invoke
end