Home>
Whether the item is on sale

I want to get purchase information from product information using an association. I want to make a conditional branch depending on the result of being able to obtain purchase information or not. Professor please

<% if user_signed_in?%>
  <% if current_user.id == @ item.user_id%>
  <% = link_to'Edit product', "#", method:: get, class: "item-red-btn"%>
  <p class ='or-text'>or</p>
  <% = link_to'Delete', "#", method:: delete, class:'item-destroy'%>
<% elsif # Is the item on sale? I don't know how to write%>
  <% = link_to'Proceed to purchase screen', "#", class: "item-red-btn"%>
<% end%>
class ItemsController
class Item
class Purchase