Sha256: 7f9c4ec259e47cac2b388d3800e70239101de6c75aa32b20af6b2eae9e7488ae
Contents?: true
Size: 789 Bytes
Versions: 26
Compression:
Stored size: 789 Bytes
Contents
- (poll_question.poll_question_options + [nil]).each do |poll_question_option| - responses = ballot_responses.select { |br| br.response.blank? } if poll_question_option.blank? - responses ||= ballot_responses.select { |br| Array(br.response).include?(poll_question_option) } - count = responses.length - total = ballot_responses.length - percent = (total.zero? ? 0 : ((count * 100.0) / total).round) - next if poll_question_option.blank? && count == 0 .poll-result-option .d-flex .mr-auto= poll_question_option.blank? ? 'None of the Above' : poll_question_option .text-muted #{count} (#{percent}%) .progress.mb-3 .progress-bar{role: 'progressbar', 'aria-valuenow': count, 'aria-valuemin': 0, 'aria-valuemax': total, style: "width: #{percent}%"}
Version data entries
26 entries across 26 versions & 1 rubygems