<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - two things seem to equal, but the UNLESS statement passes anyway.]]></title>
		<link>http://railsforum.com/viewtopic.php?id=51680</link>
		<description><![CDATA[The most recent posts in two things seem to equal, but the UNLESS statement passes anyway..]]></description>
		<lastBuildDate>Thu, 20 Dec 2012 10:20:06 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[two things seem to equal, but the UNLESS statement passes anyway.]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=157700#p157700</link>
			<description><![CDATA[<p>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&#039;ve done testing and I know the params work and they do in fact equal, but it still passes when it shouldn&#039;t</p><p>&lt;!-- finding out if there is a param for the post or we should always use the last one. --&gt;</p><p>&lt;% if params.has_key?(:which_post) %&gt;</p><p>&nbsp; &nbsp; &lt;% which_post = params[:which_post] %&gt;</p><p>&lt;% else %&gt;</p><p>&nbsp; &nbsp; &lt;% which_post = @user.messages.last.id %&gt;</p><p>&lt;% end %&gt;</p><p>&lt;!-- This is the recent activity bar --&gt;</p><p>&lt;div id=&quot;recent_activity_bar&quot;&gt;</p><p>&nbsp; &nbsp; &lt;% for message in @user.messages.reverse[(0..9)] %&gt;</p><p>&nbsp; &nbsp; &nbsp; &lt;% unless message.id == which_post %&gt; &lt;!-- the point of this is so the main post isn&#039;t <br />shown on the recent activity --&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;%= message.id %&gt; : &lt;%= which_post %&gt;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;%= message.content %&gt;&lt;br/&gt;</p><p>&nbsp; &nbsp; &nbsp; &lt;% end %&gt;</p><p>&nbsp; &nbsp; &lt;% end %&gt;</p><p>&lt;/div&gt;</p>]]></description>
			<author><![CDATA[dummy@example.com (bzupnick)]]></author>
			<pubDate>Thu, 20 Dec 2012 10:20:06 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=157700#p157700</guid>
		</item>
	</channel>
</rss>
