luis@328: module AuthorsHelper luis@540: unloadable luis@540: luis@540: def render_author_publications(author) luis@540: s = "" luis@540: pubs = [] luis@540: luis@540: author.publications.each do |pub| luis@540: pubs << link_to(pub.title, pub) luis@540: end luis@540: luis@540: if pubs.size < 3 luis@540: s << '' << pubs.join(', ') << '' luis@540: else luis@540: s << pubs.join(', ') luis@540: end luis@540: s luis@540: end luis@540: luis@612: luis@612: # Generates a link to an author luis@612: # todo: test options luis@612: def link_to_author(author, options={}, html_options = nil) luis@612: url = {:controller => 'authors', :action => 'show', :id => author}.merge(options) luis@612: link_to(h(author.name), url, html_options) luis@612: end luis@612: luis@328: end