Method: Lines::ApplicationHelper#display_article_authors

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

#display_article_authors(article, with_info = false) ⇒ Object

Returns HTML with all authors of an article



44
45
46
47
48
49
50
# File 'app/helpers/lines/application_helper.rb', line 44

def (article, with_info=false)
  authors = article.authors.map{|author| author.gplus_profile.blank? ? author.name : link_to(author.name, author.gplus_profile)}.to_sentence(two_words_connector: " & ", last_word_connector: " & ").html_safe
  if with_info
    authors += (" - " + article.authors.map{|author| (:span, "#{author.description}", class: 'author_description') }.join(" -- ")).html_safe
  end
  authors
end