Module: Bulkrax::ApplicationHelper

Defined in:
app/helpers/bulkrax/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#an_importer?(item) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/helpers/bulkrax/application_helper.rb', line 8

def an_importer?(item)
  item.class.to_s.include?('Importer')
end

#coderay(value, opts) ⇒ Object



12
13
14
15
16
17
# File 'app/helpers/bulkrax/application_helper.rb', line 12

def coderay(value, opts)
  CodeRay
    .scan(value, :ruby)
    .html(opts)
    .html_safe # rubocop:disable Rails/OutputSafety
end

#item_entry_path(item, e, opts = {}) ⇒ Object



4
5
6
# File 'app/helpers/bulkrax/application_helper.rb', line 4

def item_entry_path(item, e, opts = {})
  an_importer?(item) ? bulkrax.importer_entry_path(item.id, e.id, opts) : bulkrax.exporter_entry_path(item.id, e.id, opts)
end