Class: Revelry::Generators::Content::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Revelry::Generators::Content::InstallGenerator
- Defined in:
- lib/generators/revelry/content/install_generator.rb
Instance Method Summary collapse
- #add_controller_concern ⇒ Object
- #add_css_assets ⇒ Object
- #add_initializer ⇒ Object
- #add_js_assets ⇒ Object
- #add_migrations ⇒ Object
- #add_route ⇒ Object
Instance Method Details
#add_controller_concern ⇒ Object
26 27 28 29 30 |
# File 'lib/generators/revelry/content/install_generator.rb', line 26 def add_controller_concern insert_into_file app_controller, after: "ApplicationController < ActionController::Base\n" do "include Revelry::Content::WithRevelryContent\n" end end |
#add_css_assets ⇒ Object
14 15 16 |
# File 'lib/generators/revelry/content/install_generator.rb', line 14 def add_css_assets generate 'revelry:content:css' end |
#add_initializer ⇒ Object
18 19 20 |
# File 'lib/generators/revelry/content/install_generator.rb', line 18 def add_initializer generate 'revelry:content:initializer' end |
#add_js_assets ⇒ Object
10 11 12 |
# File 'lib/generators/revelry/content/install_generator.rb', line 10 def add_js_assets generate 'revelry:content:js' end |
#add_migrations ⇒ Object
5 6 7 8 |
# File 'lib/generators/revelry/content/install_generator.rb', line 5 def add_migrations generate 'revelry:content:migrations' rake 'db:migrate' end |
#add_route ⇒ Object
22 23 24 |
# File 'lib/generators/revelry/content/install_generator.rb', line 22 def add_route route 'mount Revelry::Content::Engine => "/revelry_content"' end |