Class: Bpluser::ControllerGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Bpluser::ControllerGenerator
- Defined in:
- lib/generators/bpluser/controller_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_folders_show_tool ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/generators/bpluser/controller_generator.rb', line 19 def add_folders_show_tool target_file = 'app/controllers/catalog_controller.rb' return unless File.read(target_file).include?('folder_item_control') marker = 'configure_blacklight do |config|' insert_into_file target_file, after: marker do "\nconfig.add_show_tools_partial :folder_items, partial: 'folder_item_control'" end end |
#inject_application_controller_behavior ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/generators/bpluser/controller_generator.rb', line 9 def inject_application_controller_behavior target_file = 'app/controllers/application_controller.rb' return unless File.read(target_file).include?('Bpluser::Controller') marker = 'include Blacklight::Controller' insert_into_file target_file, after: marker do "\ninclude Bpluser::Controller" end end |