Module: Blacklight::DefaultComponentConfiguration::ClassMethods

Defined in:
app/controllers/concerns/blacklight/default_component_configuration.rb

Instance Method Summary collapse

Instance Method Details

#add_show_tools_partial(name, opts = {}) ⇒ Object

Add a partial to the tools for rendering a document

Parameters:

  • name (String)

    the name of the document partial

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :if (Symbol, Proc)

    render this action if the method identified by the symbol or the proc evaluates to true. The proc will receive the action configuration and the document or documents for the action.

  • :unless (Symbol, Proc)

    render this action unless the method identified by the symbol or the proc evaluates to true. The proc will receive the action configuration and the document or documents for the action.

  • :define_method (Boolean)

    define a controller method as named, default: true

  • :validator (Symbol)

    method for toggling between success and failure, should return Boolean (true if valid)

  • :callback (Symbol)

    method for further processing of documents, receives Array of documents



40
41
42
43
# File 'app/controllers/concerns/blacklight/default_component_configuration.rb', line 40

def add_show_tools_partial(name, opts = {})
  blacklight_config.add_show_tools_partial(name, opts)
  ActionBuilder.new(self, name, opts).build
end