Module: ContainerItemsHelper
- Defined in:
- app/helpers/container_items_helper.rb
Instance Method Summary collapse
-
#container_item_container_label(container_item) ⇒ Object
TODO: make generic.
- #container_item_link(container_item) ⇒ Object
- #container_item_tag(container_item) ⇒ Object
- #container_items_search_form ⇒ Object
Instance Method Details
#container_item_container_label(container_item) ⇒ Object
TODO: make generic
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/helpers/container_items_helper.rb', line 18 def container_item_container_label(container_item) return nil if container_item.nil? o = container_item.contained_object case container_item.contained_object_type when 'CollectionObject' label_for_collection_object_container(o) when 'Extract' label_for_extract_container(o) when 'Container' label_for_container_container(o) else "NO CONTAINER LABEL FOR A #{ container_item.container_object_type }, poke your developers!" end end |
#container_item_link(container_item) ⇒ Object
8 9 10 11 |
# File 'app/helpers/container_items_helper.rb', line 8 def container_item_link(container_item) return nil if container_item.nil? link_to(container_item_tag(container_item).html_safe, container_item) end |
#container_item_tag(container_item) ⇒ Object
3 4 5 6 |
# File 'app/helpers/container_items_helper.rb', line 3 def container_item_tag(container_item) return nil if container_item.nil? object_tag(container_item.contained_object) end |
#container_items_search_form ⇒ Object
13 14 15 |
# File 'app/helpers/container_items_helper.rb', line 13 def container_items_search_form render('/container_items/quick_search_form') end |