I have 2 models, one is for Users, and the other is for Medications. Each user can have many medications. The user can create medications, but can't see medications other users made.
<% @medications.each do |medication| %>
<tr>
<td><%= medication.name %></td>
<td><%= medication.user_id %> </td>
Obviously this code doesn't do what I want, but how can I modify the first part to be a conditional that only works if current_user.id == medication.user_id?