bumper
1
Please be gentile … I am new at this ror thing
I have a view which looks like this
Nicaragua Stamps
| Scott |
Maxwell |
Description |
Url |
Mint |
Used |
<% @stamps.each do |stamp| %>
| <%=h stamp.Scott %> |
<%=h stamp.Maxwell %> |
<%=h stamp.Description %> |
<%=h stamp.url %> |
<td>
<% if stamp.Mint == true %>
<img src="/images/yes.gif" alt = "yes"/>
<%else%>
<img src="/images/no.gif" alt = "no"/>
<%end%>
</td>
<td>
<% if stamp.Mint == true %>
<img src="/images/yes.gif" alt = "yes"/>
<%else %>
<img src="/images/no.gif" alt = "no"/>
<%end%>
</td>
<td><%= link_to 'Show', stamp %></td>
<td><%= link_to 'Edit', edit_stamp_path(stamp) %></td>
<td><%= link_to 'Destroy', stamp, :confirm => 'Are you
sure?’, :method => :delete %>
<% end %>
<%= link_to ‘New stamp’, new_stamp_path %>
When the if statement is executed the first time it seems ok but on
the subsequent times it shows only true.
I hope this makes sense …
bumper
2
<% if stamp.Mint == true %>
<img src="/images/yes.gif" alt = "yes"/>
<%else%>
<img src="/images/no.gif" alt = "no"/>
<%end%>
</td>
<td>
<% if stamp.Mint == true %>
<img src="/images/yes.gif" alt = "yes"/>
<%else %>
<img src="/images/no.gif" alt = "no"/>
<%end%>
Well, you should invert the logic for your second case, if Mint is true,
then Used column should show No, no?
Was that your question?