Topic: two things seem to equal, but the UNLESS statement passes anyway.
when params[:which_post] happens to equal the users last message, the unless staement on line 10 passes when in fact they both equal. I've done testing and I know the params work and they do in fact equal, but it still passes when it shouldn't
<!-- finding out if there is a param for the post or we should always use the last one. -->
<% if params.has_key?(:which_post) %>
<% which_post = params[:which_post] %>
<% else %>
<% which_post = @user.messages.last.id %>
<% end %>
<!-- This is the recent activity bar -->
<div id="recent_activity_bar">
<% for message in @user.messages.reverse[(0..9)] %>
<% unless message.id == which_post %> <!-- the point of this is so the main post isn't
shown on the recent activity -->
<%= message.id %> : <%= which_post %>
<%= message.content %><br/>
<% end %>
<% end %>
</div>
Last edited by bzupnick (2012-12-20 06:21:16)