Module: TaxonDeterminationsHelper
- Defined in:
- app/helpers/taxon_determinations_helper.rb
Instance Method Summary collapse
-
#determination_tag(taxon_determination) ⇒ String
As for taxon_determination_tag but does not reference collection object.
-
#taxon_determination_by(taxon_determination) ⇒ String
The “by” clause of the determination.
-
#taxon_determination_link(taxon_determination) ⇒ String
As for taxon_determination_tag but does not reference collection object, links to OTU.
-
#taxon_determination_on(taxon_determination) ⇒ String
The date clause of the determination.
-
#taxon_determination_tag(taxon_determination) ⇒ String?
A descriptor, contains name only (if you want to include the identifier use collection_object_tag).
Instance Method Details
#determination_tag(taxon_determination) ⇒ String
Returns as for taxon_determination_tag but does not reference collection object
12 13 14 15 16 17 18 |
# File 'app/helpers/taxon_determinations_helper.rb', line 12 def determination_tag(taxon_determination) return nil if taxon_determination.nil? [ otu_tag(taxon_determination.otu), taxon_determination_by(taxon_determination), taxon_determination_on(taxon_determination) ].join(' ').html_safe end |
#taxon_determination_by(taxon_determination) ⇒ String
Returns the “by” clause of the determination
31 32 33 34 |
# File 'app/helpers/taxon_determinations_helper.rb', line 31 def taxon_determination_by(taxon_determination) names = taxon_determination.determiners.collect{|d| d.last_name }.to_sentence names.blank? ? nil : "by #{names}" end |
#taxon_determination_link(taxon_determination) ⇒ String
Returns as for taxon_determination_tag but does not reference collection object, links to OTU
22 23 24 25 26 27 |
# File 'app/helpers/taxon_determinations_helper.rb', line 22 def taxon_determination_link(taxon_determination) [ link_to(determination_tag(taxon_determination), taxon_determination.otu), taxon_determination_by(taxon_determination), taxon_determination_on(taxon_determination) ].join(' ').html_safe end |
#taxon_determination_on(taxon_determination) ⇒ String
Returns the date clause of the determination
38 39 40 |
# File 'app/helpers/taxon_determinations_helper.rb', line 38 def taxon_determination_on(taxon_determination) !taxon_determination.date.blank? ? "on #{taxon_determination.date}" : nil end |
#taxon_determination_tag(taxon_determination) ⇒ String?
Returns a descriptor, contains name only (if you want to include the identifier use collection_object_tag)
5 6 7 8 |
# File 'app/helpers/taxon_determinations_helper.rb', line 5 def taxon_determination_tag(taxon_determination) return nil if taxon_determination.nil? ['determined as', determination_tag(taxon_determination) ].join(' ').html_safe end |