Module: OtusHelper

Defined in:
app/helpers/otus_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (String) otu_autocomplete_selected_tag(otu)

Returns no HTML inside <input>

Returns:

  • (String)

    no HTML inside <input>



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

def otu_autocomplete_selected_tag(otu)
  return nil if otu.nil? || (otu.new_record? && !otu.changed?)
  [otu.name, 
   Utilities::Strings.nil_wrap('[',taxon_name_autocomplete_selected_tag(otu.taxon_name), ']')
  ].compact.join(' ')
end


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

def otu_link(otu)
  return nil if otu.nil?
  link_to(otu_tag(otu).html_safe, otu)
end

- (Object) otu_tag(otu)



3
4
5
6
7
8
# File 'app/helpers/otus_helper.rb', line 3

def otu_tag(otu)
  return nil if otu.nil?
  a = (:span, otu.name, class: :otu_tag_otu_name) if otu.name
  b = (:span, full_taxon_name_tag(otu.taxon_name).html_safe, class: :otu_tag_taxon_name) if otu.taxon_name_id
  (:span, [a,b].flatten.join.html_safe, class: :otu_tag)
end


28
29
30
# File 'app/helpers/otus_helper.rb', line 28

def otus_link_list_tag(otus)
  otus.collect { |o| link_to(o.name, o) }.join(",")
end

- (Object) otus_search_form



24
25
26
# File 'app/helpers/otus_helper.rb', line 24

def otus_search_form
  render('/otus/quick_search_form')
end