diff --git a/content/index.html.erb b/content/index.html.erb index 4e21fe4..289156a 100644 --- a/content/index.html.erb +++ b/content/index.html.erb @@ -35,11 +35,8 @@ unless @items["/cover/#{book[:isbn]}.*"].nil? <%= book[:author] %>

- <% book[:rating].times do |star_on| %> - <%= star_svg(filled: true) %> - <% end %> - <% (10 - book[:rating]).times do |star_off| %> - <%= star_svg(filled: false) %> + <% 10.times do |i| %> + <%= star_svg(filled: i < book[:rating]) %> <% end %>

diff --git a/layouts/book.html.erb b/layouts/book.html.erb index 93fb34b..a662452 100644 --- a/layouts/book.html.erb +++ b/layouts/book.html.erb @@ -7,11 +7,8 @@

<%= @item[:author] %>

-<% @item[:rating].times do |star_on| %> -<%= star_svg(filled: true) %> -<% end %> -<% (10 - @item[:rating]).times do |star_off| %> -<%= star_svg(filled: false) %> +<% 10.times do |i| %> +<%= star_svg(filled: i < @item[:rating]) -%> <% end %>