Module: ConfidencesHelper

Defined in:
app/helpers/confidences_helper.rb

Instance Method Summary (collapse)

Instance Method Details



17
18
19
20
21
22
# File 'app/helpers/confidences_helper.rb', line 17

def add_confidence_link(object: nil)
  link_to('Add confidence', new_confidence_path( 
                                                confidence_object_type: object.class.base_class.name,
                                                confidence_object_id: object.id
                                               )) if object.has_confidences?
end


8
9
10
11
# File 'app/helpers/confidences_helper.rb', line 8

def confidence_link(confidence)
  return nil if confidence.nil?
  link_to(confidence_tag(confidence), confidence)
end

- (Object) confidence_tag(confidence)



3
4
5
6
# File 'app/helpers/confidences_helper.rb', line 3

def confidence_tag(confidence)
  return nil if confidence.nil?
  (:span, confidence.confidence_level.name, style: "background-color: #{confidence.confidence_level.css_color};")
end

- (Object) confidences_search_form



13
14
15
# File 'app/helpers/confidences_helper.rb', line 13

def confidences_search_form
  render('/confidences/quick_search_form')
end