Module: ExtractsHelper

Defined in:
app/helpers/extracts_helper.rb

Instance Method Summary collapse

Instance Method Details



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

def extract_link(extract)
  return nil if extract.nil?
  link_to(extract_tag(extract), extract)
end

#extract_tag(extract) ⇒ Object

TODO: reference identifiers/origin objects etc.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/extracts_helper.rb', line 4

def extract_tag(extract)
  return nil if extract.nil?
  e = []

  if extract.old_objects.any?
    e.push ' from: '
    e.push extract.old_objects.collect{|o| object_link(o) } 
  else
    "#{extract.id} (no origin)"
  end

  e.push "Extract " + extract.id.to_s if e.empty?

  e.join.html_safe 
end

#extracts_search_formObject



25
26
27
# File 'app/helpers/extracts_helper.rb', line 25

def extracts_search_form
  render('/extracts/quick_search_form')
end