<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in 'flash[:notice] gets reset unexpectedly' | Pragmatic Forums</title>
    <link>http://forums.pragprog.com/forums/22/topics/328</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <description></description>
    <item>
      <title>flash[:notice] gets reset unexpectedly posted by PerlFan @ Thu, 03 Apr 2008 21:25:41 -0000</title>
      <description>&lt;p&gt;I asked a friend who is way more familiar with Ruby/Rails about this.  He suggested that I ensure that my browser was accepting cookies from localhost.&lt;/p&gt;


	&lt;p&gt;However, in the period of time since I originally posted my query, I kindof gave up on getting flash[:notice] to ever work.  I also totally upgraded my Linux box to Fedora8, and, in the process, I ended up with a slightly newer copy of Firefox (2.0.0.8-2.fc8)&amp;#8212;I still had the same $HOME/.mozilla directory though.&lt;/p&gt;


	&lt;p&gt;So, I took my friend&amp;#8217;s suggestion to check for my browser&amp;#8217;s cookie preferences.  This yielded nothing.&lt;/p&gt;


	&lt;p&gt;However, I tried this again (with &amp;#8220;ruby script/server&amp;#8221; running on an old, unupgraded machine and my browser running on my new Fedora 8 box) and now I can see the flash[:notice] message!&lt;/p&gt;


	&lt;p&gt;I really don&amp;#8217;t understand why this would be so, but now it works.&lt;/p&gt;


	&lt;p&gt;Reminder:  I couldn&amp;#8217;t see the desired output in the &lt;span class="caps"&gt;HTML&lt;/span&gt; source in my old browser and I have the same $HOME/.mozilla directory as I did before the upgrade.  So, I can&amp;#8217;t begin to understand why this works.&lt;/p&gt;


	&lt;p&gt;I guess I&amp;#8217;ll just accept that it works and be thankful for this.&lt;/p&gt;</description>
      <pubDate>Thu, 03 Apr 2008 21:25:41 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:22:328:2538</guid>
      <author>PerlFan</author>
      <link>http://forums.pragprog.com/forums/22/topics/328</link>
    </item>
    <item>
      <title>flash[:notice] gets reset unexpectedly posted by PerlFan @ Sat, 22 Mar 2008 05:22:11 -0000</title>
      <description>&lt;p&gt;I am diligently going through the Depot example in the &lt;span class="caps"&gt;AWDWR&lt;/span&gt; 2nd Ed. book.  I have made it to the end of section 8.4/p109.&lt;/p&gt;


	&lt;p&gt;My store_controller.rb and store.rhtml files are pretty much exactly as they are in the files that I downloaded from the website.&lt;/p&gt;


	&lt;p&gt;My problem?:  when I access &lt;a href="http://localhost:3000/store/wibble"&gt;http://localhost:3000/store/wibble&lt;/a&gt;, my browser gets redirected properly, but I never see the error text in flash[:notice] because it is empty for some reason.&lt;/p&gt;


	&lt;p&gt;I do see the expected messages in the log/development.log file:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;Attempt to access invalid product whibble
flash[:notice] is now Invalid product           [I added this; debug code]
Redirected to &lt;a href="http://localhost:3000/store"&gt;http://localhost:3000/store&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;I have modified the store.rhtml file to unconditionally print out flash[:notice] but it is always blank.  I am even looking at the &lt;span class="caps"&gt;HTML&lt;/span&gt; source to be sure.&lt;/p&gt;


	&lt;p&gt;I am at a loss to understand why flash[:notice] is blank.  I know very little about Ruby or Rails so I&amp;#8217;m not quite sure how this should work and I&amp;#8217;m not familiar enough with the system to catch this variable getting reset.&lt;/p&gt;


	&lt;p&gt;Can anybody offer suggestions as to why this variable might be getting reset?&lt;/p&gt;


	&lt;p&gt;My environment:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;$ ruby -v
ruby 1.8.5 (2007-03-13 patchlevel 35) [i386-linux]
$ rails -v
Rails 1.2.6&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;I am also using sqlite3, and I have verified that the exception that is getting
thrown corresponds to my code.&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;&lt;span class="caps"&gt;THANKS&lt;/span&gt;!&lt;/p&gt;</description>
      <pubDate>Sat, 22 Mar 2008 05:22:11 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:22:328:2473</guid>
      <author>PerlFan</author>
      <link>http://forums.pragprog.com/forums/22/topics/328</link>
    </item>
  </channel>
</rss>
