Thursday, June 17, 2010

[Rails] Help .. A question about if then

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

<h1>Nicaragua Stamps</h1>

<table id ="stamps">
<tr>
<th>Scott</th>
<th>Maxwell</th>
<th>Description</th>
<th>Url</th>
<th>Mint</th>
<th>Used</th>
</tr>

<% @stamps.each do |stamp| %>
<tr class="alt">
<td><%=h stamp.Scott %></td>
<td><%=h stamp.Maxwell %></td>
<td><%=h stamp.Description %></td>
<td><%=h stamp.url %></td>

<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 %></td>
</tr>
<% end %>
</table>

<br />

<%= 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 ...

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate