Percentage to csv

This commit is contained in:
Petko Bordjukov 2015-10-15 21:41:19 +03:00
parent 824228fe1b
commit de87c64c05
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
<%= CSV.generate_line([talk.id, talk.event_type.name, talk.title, talk.subtitle, @ratings[talk.id]]).html_safe -%> <%= CSV.generate_line([talk.id, talk.event_type.name, talk.title, talk.subtitle, @ratings[talk.id], "%.2f%" % Rational(100 * @ratings[talk.id], @votes_count).to_f]).html_safe -%>

View File

@ -1,3 +1,3 @@
<%- headers = ['ID', 'Type', 'Title', 'Subtitle', 'Votes'] -%> <%- headers = ['ID', 'Type', 'Title', 'Subtitle', 'Votes', '%'] -%>
<%= CSV.generate_line headers -%> <%= CSV.generate_line headers -%>
<%= render partial: 'talk', collection: @talks %> <%= render partial: 'talk', collection: @talks %>