ref: master
app/helpers/document_helper.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
module DocumentHelper # displays an icon corresponding to the document passed in +doc+. # # The class of the document can define its icon by providing an +icon+ # method (i.e. +doc.class.icon+ will be called) def icon_for_document(doc) icon = case doc when Article 'text-x-generic' else if doc.class.respond_to?(:icon) doc.class.icon else 'none' end end design_display_icon(icon) end end |