# Help .. A question about if then

**URL:** <https://www.ruby-forum.com/t/help-a-question-about-if-then/190334>\
**Category:** Rails\
**Created:** [June 17, 2010, 9:42pm UTC](https://www.ruby-forum.com/t/help-a-question-about-if-then/190334 "2010-06-17T21:42:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bumper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@bumper](https://www.ruby-forum.com/u/bumper)\
**Post date:** [June 17, 2010, 9:42pm UTC](https://www.ruby-forum.com/t/help-a-question-about-if-then/190334/1 "2010-06-17T21:42:17Z")

</div>

Please be gentile … I am new at this ror thing  
I have a view which looks like this

# Nicaragua Stamps

\<% @stamps.each do |stamp| %\>

```
<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 %\>

| Scott | Maxwell | Description | Url | Mint | Used |
| --- | --- | --- | --- | --- | --- |
| \<%=h stamp.Scott %\> | \<%=h stamp.Maxwell %\> | \<%=h stamp.Description %\> | \<%=h stamp.url %\> |

  

\<%= 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 …

---

<div class="post-metadata">

**Author:** ![bumper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@bumper](https://www.ruby-forum.com/u/bumper)\
**Post date:** [June 17, 2010, 9:56pm UTC](https://www.ruby-forum.com/t/help-a-question-about-if-then/190334/2 "2010-06-17T21:56:22Z")

</div>

> ```
> <% 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?
