Last active
August 29, 2015 14:25
-
-
Save seyna/c79ea433a3e46b6b8a5f to your computer and use it in GitHub Desktop.
A possible way to fix error message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="puzzle-history-container"> | |
<% @user_lotteries.each do |lottery| %> | |
<% @user_get_pieces = @user_pieces.where(:lottery_id => lottery.id) %> | |
<div class="puzzle-history-title"><%= lottery.serial_number %></div> | |
<!-- START of a puzzle row --> | |
<div class="puzzle-box-row"> | |
<div class="puzzle-box"> | |
<% puzzle_id = 1 %> | |
<% @user_get_pieces.where(:puzzle_id => puzzle_id).each do |p| %> | |
<!-- to make sure that no error will happen when no image exists --> | |
<% if Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).size > 0 %> | |
<% image_url = Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).first.image(:thumb) %> | |
<div class="puzz<%= p.position_number %>"><span class="piece-count"></span><img class="piece" src="<%= image_url %>"></div> | |
<% end %> | |
<% end %> | |
<img class="puzzle-bg" src="<%= @prize_bg_images[puzzle_id-1] %>"> | |
</div> | |
<div class="puzzle-box"> | |
<% puzzle_id = 2 %> | |
<% @user_get_pieces.where(:puzzle_id => puzzle_id).each do |p| %> | |
<!-- to make sure that no error will happen when no image exists --> | |
<% if Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).size > 0 %> | |
<% image_url = Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).first.image(:thumb) %> | |
<div class="puzz<%= p.position_number %>"><span class="piece-count"></span><img class="piece" src="<%= image_url %>"></div> | |
<% end %> | |
<% end %> | |
<img class="puzzle-bg" src="<%= @prize_bg_images[puzzle_id-1] %>"> | |
</div> | |
<div class="puzzle-box"> | |
<% puzzle_id = 3 %> | |
<% @user_get_pieces.where(:puzzle_id => puzzle_id).each do |p| %> | |
<!-- to make sure that no error will happen when no image exists --> | |
<% if Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).size > 0 %> | |
<% image_url = Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).first.image(:thumb) %> | |
<div class="puzz<%= p.position_number %>"><span class="piece-count"></span><img class="piece" src="<%= image_url %>"></div> | |
<% end %> | |
<% end %> | |
<img class="puzzle-bg" src="<%= @prize_bg_images[puzzle_id-1] %>"> | |
</div> | |
<div class="puzzle-box"> | |
<% puzzle_id = 4 %> | |
<% @user_get_pieces.where(:puzzle_id => puzzle_id).each do |p| %> | |
<!-- to make sure that no error will happen when no image exists --> | |
<% if Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).size > 0 %> | |
<% image_url = Puzzleimage.where(:puzzle_id => puzzle_id).where(:position_number => p.position_number).first.image(:thumb) %> | |
<div class="puzz<%= p.position_number %>"><span class="piece-count"></span><img class="piece" src="<%= image_url %>"></div> | |
<% end %> | |
<% end %> | |
<img class="puzzle-bg" src="<%= @prize_bg_images[puzzle_id-1] %>"> | |
</div> | |
</div> | |
<!-- END of a puzzle row --> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment