Module: ProtocolsHelper

Defined in:
app/helpers/protocols_helper.rb

Instance Method Summary (collapse)

Instance Method Details



21
22
23
24
25
26
# File 'app/helpers/protocols_helper.rb', line 21

def add_protocol_link(object: nil, attribute: nil)
  link_to('Add protocol', new_protocol_relationship_path(protocol_relationship: {
                                    protocol_object_type:      object.class.base_class.name,
                                    protocol_object_id:        object.id,
                                    protocol_object_attribute: attribute})) if object.has_protocols?
end

- (Object) protocol_autocomplete_selected_tag(protocol)



16
17
18
19
# File 'app/helpers/protocols_helper.rb', line 16

def protocol_autocomplete_selected_tag(protocol)
  return nil if protocol.nil?
  protocol_tag(protocol)
end


7
8
9
10
# File 'app/helpers/protocols_helper.rb', line 7

def protocol_link(protocol)
  return nil if protocol.nil?
  link_to(protocol_tag(protocol).html_safe, protocol)
end

- (Object) protocol_tag(protocol)



2
3
4
5
# File 'app/helpers/protocols_helper.rb', line 2

def protocol_tag(protocol)
  return nil if protocol.nil?
  protocol.name
end

- (Object) protocols_search_form



12
13
14
# File 'app/helpers/protocols_helper.rb', line 12

def protocols_search_form
  render('/protocols/quick_search_form')
end