Introduce a conflicts controller
This commit is contained in:
parent
485116e29c
commit
f5022dd138
|
@ -0,0 +1,5 @@
|
||||||
|
class ConflictsController < ApplicationController
|
||||||
|
def index
|
||||||
|
@talks = Talk.find(:all, from: :halfnarp_friendly).sort_by(&:title)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
<%- csv_headers = ['Event'] + @talks.map { |talk| [talk.title, talk.id].join(' ') } -%>
|
||||||
|
<%= CSV.generate_line(csv_headers).html_safe -%>
|
||||||
|
<%- @talks.each do |left| -%>
|
||||||
|
<%= CSV.generate_line([[left.title, left.id].join(' ')] + @talks.map { |right| left.id == right.id ? '-' : ConflictCoefficient.new(left.id, right.id).per_cent}).html_safe -%>
|
||||||
|
<%- end -%>
|
|
@ -1 +0,0 @@
|
||||||
<%= CSV.generate_line([conflict_coefficient.left, conflict_coefficient.right, conflict_coefficient.conflicts, conflict_coefficient.per_cent]).html_safe -%>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<%- headers = ['left', 'right', 'conflicts', '%'] -%>
|
|
||||||
<%= CSV.generate_line headers -%>
|
|
||||||
<%= render partial: 'conflict_coefficient', collection: @conflict_coefficients %>
|
|
Loading…
Reference in New Issue