Skip to content

Commit

Permalink
add safe nav for 'array_of_hash' (#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
cziaarm authored Jan 19, 2024
1 parent 1404921 commit c4fa452
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% array_size = (array_of_hash.size <= 5 ? array_of_hash.size - 1 : 4) %>
<% array_size = (array_of_hash&.size <= 5 ? array_of_hash.size - 1 : 4) %>
<% array_of_hash.each_with_index do |hash, index| %>
<% if index <= 4 %>
<span itemprop='<%= "#{attr_name}" %>'>
Expand Down Expand Up @@ -56,4 +56,4 @@
<% end %>
</span>
<% end %>
<% end %>
<% end %>

0 comments on commit c4fa452

Please sign in to comment.