Add percentage
This commit is contained in:
parent
0fbe3243c4
commit
824228fe1b
|
@ -5,6 +5,7 @@ class HomeController < ApplicationController
|
|||
def ratings
|
||||
@talks = Talk.ordered_by_rating
|
||||
@ratings = Ratings.new
|
||||
@votes_count = TalkPreference.count
|
||||
end
|
||||
|
||||
def export
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
<td><%= talk.title %></td>
|
||||
<td><%= talk.subtitle %></td>
|
||||
<td><%= @ratings[talk.id] %></td>
|
||||
<td><%= "%.2f%" % Rational(100 * @ratings[talk.id], @votes_count).to_f %></td>
|
||||
</tr>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<th>Title</th>
|
||||
<th>Subtitle</th>
|
||||
<th>Votes</th>
|
||||
<th>%</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
Loading…
Reference in New Issue