Module: ProtocolRelationshipsHelper
- Defined in:
- app/helpers/protocol_relationships_helper.rb
Instance Method Summary collapse
- #label_for_protocol_relationship(protocol_relationship) ⇒ Object
- #protocol_relationship_link(protocol_relationship) ⇒ Object
- #protocol_relationship_tag(protocol_relationship) ⇒ Object
- #protocol_relationships_search_form ⇒ Object
Instance Method Details
#label_for_protocol_relationship(protocol_relationship) ⇒ Object
11 12 13 14 |
# File 'app/helpers/protocol_relationships_helper.rb', line 11 def label_for_protocol_relationship(protocol_relationship) return nil if protocol_relationship.nil? label_for_protocol(protocol_relationship.protocol) + ': ' + label_for(protocol_relationship.protocol_relationship_object) end |
#protocol_relationship_link(protocol_relationship) ⇒ Object
16 17 18 19 |
# File 'app/helpers/protocol_relationships_helper.rb', line 16 def protocol_relationship_link(protocol_relationship) return nil if protocol_relationship.nil? link_to(protocol_relationship_tag(protocol_relationship), protocol_relationship) end |
#protocol_relationship_tag(protocol_relationship) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'app/helpers/protocol_relationships_helper.rb', line 2 def protocol_relationship_tag(protocol_relationship) return nil if protocol_relationship.nil? [ protocol_tag(protocol_relationship.protocol).html_safe, (' used on ' + protocol_relationship.protocol_relationship_object_type + ': '), tag.span( label_for(protocol_relationship.protocol_relationship_object).truncate(80), class: [:feedback, 'feedback-thin', 'feedback-secondary']).html_safe ].join.html_safe end |
#protocol_relationships_search_form ⇒ Object
21 22 23 |
# File 'app/helpers/protocol_relationships_helper.rb', line 21 def protocol_relationships_search_form render('/protocol_relationships/quick_search_form') end |