Fixed nil rating bug

This commit is contained in:
Dan Elbert 2016-09-28 17:18:17 -05:00
parent 0990551cfc
commit 92b962e6b9
2 changed files with 2 additions and 6 deletions

View File

@ -24,8 +24,4 @@ class RecipeDecorator < BaseDecorator
end
end
def average_rating
rating
end
end

View File

@ -33,8 +33,8 @@
<tr>
<td><%= link_to recipe.short_name, recipe %></td>
<td>
<% if recipe.average_rating > 0 %>
<%= text_field_tag('rating', recipe.average_rating, disabled: true, data: {rating: true, size: '20px', interval: '0.25'}) %>
<% if recipe.rating %>
<%= text_field_tag('rating', recipe.rating, disabled: true, data: {rating: true, size: '20px', interval: '0.25'}) %>
<% else %>
--
<% end %>