Currently I have
<b>Step 1</b>
<%= @recipe_records.instruct_1 %>
</p>
<p>
<b>Step 2</b>
<%= @recipe_records.instruct_2 %>
</p>
.....
<b>Step 30</b>
<%= @recipe_records.instruct_30 %>
</p>
How do I put it in a loop instead of listing all 30 steps and to not display empty steps?
<% 30.times do |n|%>
<% ri = @recipe_records.instruct_#{n+1}%>
<%= if !ri.empty? %>
<p>
<%= ri %>
<% end%>
<% end %>
Tried but unable to work.
After some fidling, I’ve got the following working codes: