Module: BatchSelectHelper

Defined in:
app/helpers/batch_select_helper.rb

Overview

View Helpers for Hydra Batch Edit functionality

Instance Method Summary collapse

Instance Method Details

#batch_check_all(label = 'Use all results') ⇒ Object

Displays the check all button to select/deselect items for your batch. Put this in your search result page template. We put it in catalog/index.html



20
21
22
# File 'app/helpers/batch_select_helper.rb', line 20

def batch_check_all(label = 'Use all results')
  render partial: '/batch_select/check_all', locals: { label: label }
end

#batch_select_toolsObject

Displays the batch edit tools. Put this in your search result page template. We recommend putting it in catalog/_sort_and_per_page.html.erb



9
10
11
# File 'app/helpers/batch_select_helper.rb', line 9

def batch_select_tools
  render partial: '/batch_select/tools'
end

#button_for_add_to_batch(document) ⇒ Object

Displays the button to select/deselect items for your batch. Call this in the index partial that’s rendered for each search result.

Parameters:

  • document (Hash)

    the Hash (aka Solr hit) for one Solr document



15
16
17
# File 'app/helpers/batch_select_helper.rb', line 15

def button_for_add_to_batch(document)
  render partial: '/batch_select/add_button', locals: { document: document }
end