Class: Blacklight::LocalePicker::Install
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Blacklight::LocalePicker::Install
- Defined in:
- lib/generators/blacklight/locale_picker/install_generator.rb
Overview
Blacklight::LocalePicker install generator
Instance Method Summary collapse
- #add_locale_picker_helpers ⇒ Object
- #add_locale_picker_to_controller ⇒ Object
- #install_webpacker ⇒ Object
Instance Method Details
#add_locale_picker_helpers ⇒ Object
17 18 19 20 21 |
# File 'lib/generators/blacklight/locale_picker/install_generator.rb', line 17 def add_locale_picker_helpers inject_into_file 'app/helpers/application_helper.rb', after: 'module ApplicationHelper' do "\n include Blacklight::LocalePicker::LocaleHelper" end end |
#add_locale_picker_to_controller ⇒ Object
11 12 13 14 15 |
# File 'lib/generators/blacklight/locale_picker/install_generator.rb', line 11 def add_locale_picker_to_controller inject_into_file 'app/controllers/application_controller.rb', after: 'include Blacklight::Controller' do "\n include Blacklight::LocalePicker::Concern" end end |
#install_webpacker ⇒ Object
23 24 25 26 27 |
# File 'lib/generators/blacklight/locale_picker/install_generator.rb', line 23 def install_webpacker return unless Rails.version.to_i == 6 rake 'webpacker:install' end |