<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in 'Confusion in iteration F4 (ch 11.4)' | Pragmatic Forums</title>
    <link>http://forums.pragprog.com/forums/66/topics/523</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <description></description>
    <item>
      <title>Confusion in iteration F4 (ch 11.4) posted by Sam Ruby @ Fri, 27 Jun 2008 08:19:28 -0000</title>
      <description>&lt;p&gt;The next beta will have little triangles pointing at the&lt;/p&gt;


&lt;blockquote&gt;
	&lt;p&gt;&amp;lt;% if @cart %&amp;gt;&lt;/p&gt;

&lt;/blockquote&gt;




	&lt;p&gt;and&lt;/p&gt;


&lt;blockquote&gt;
	&lt;p&gt;&amp;lt;% end %&amp;gt;&lt;/p&gt;

&lt;/blockquote&gt;




	&lt;p&gt;lines in the &lt;a href="http://media.pragprog.com/titles/rails3/code/depot_q/app/views/layouts/store.html.erb"&gt;depot_q/app/views/layouts/store.html.erb&lt;/a&gt; file excerpt that immediately follows that paragraph.  I apologize for the omission.&lt;/p&gt;</description>
      <pubDate>Fri, 27 Jun 2008 08:19:28 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:66:523:3377</guid>
      <author>Sam Ruby</author>
      <link>http://forums.pragprog.com/forums/66/topics/523</link>
    </item>
    <item>
      <title>Confusion in iteration F4 (ch 11.4) posted by Breno Gazzola @ Wed, 25 Jun 2008 21:46:11 -0000</title>
      <description>&lt;p&gt;I think that the problem is, if we visit the admin page immediately after setting the store layout, we will get the following error:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.items
&lt;/code&gt;&lt;br /&gt;Extracted source (around line #25): &lt;br /&gt;&lt;code&gt;
22:     &amp;lt;div id="side"&amp;gt;
23:       &amp;lt;!-- START_HIGHLIGHT --&amp;gt;
24:       &amp;lt;!-- START:hidden_div --&amp;gt;
25:       &amp;lt;% hidden_div_if(@cart.items.empty?, :id =&amp;gt; "cart") do %&amp;gt;
26:         &amp;lt;%= render(:partial =&amp;gt; "cart", :object =&amp;gt; @cart) %&amp;gt;
27:       &amp;lt;% end %&amp;gt;
28:     &amp;lt;!-- END:hidden_div --&amp;gt;
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;

	&lt;p&gt;This is because the hidden cart div is still trying to .items when there is no @cart present. If we look for a solution in the text on the same page we will find this:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Now all we need to do is to prevent the hidden cart div from being present&lt;br /&gt;at all for functions where there is no cart, and to add links to the various&lt;br /&gt;administration functions to the sidebar in the layout(...)&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;However it&amp;#8217;s never explained how do we prevent the cart div from being present, only how to add the links.&lt;/p&gt;</description>
      <pubDate>Wed, 25 Jun 2008 21:46:11 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:66:523:3346</guid>
      <author>Breno Gazzola</author>
      <link>http://forums.pragprog.com/forums/66/topics/523</link>
    </item>
    <item>
      <title>Confusion in iteration F4 (ch 11.4) posted by Sam Ruby @ Wed, 11 Jun 2008 14:07:18 -0000</title>
      <description>&lt;p&gt;Help me understand where the instructions aren&amp;#8217;t clear.  Here&amp;#8217;s the current text:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Now if we visit &lt;a href="http://localhost:3000/admin"&gt;http://localhost:3000/admin&lt;/a&gt; we see the familiar Pragmatic Bookshelf&lt;br /&gt;banner and sidebar. But if we visit &lt;a href="http://localhost:3000/users"&gt;http://localhost:3000/users&lt;/a&gt; we do not. It&lt;br /&gt;turns out that there is one more thing that we need to do: we need to stop&lt;br /&gt;the generated scaffolding from overriding the application default layout. And&lt;br /&gt;nothing could be easier. We simply need to remove the generated layouts, and&lt;br /&gt;refresh.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;This text says that if you visit /users you will see a problem, and what the solution to that problem is.&lt;/p&gt;


	&lt;p&gt;What am I missing?&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 14:07:18 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:66:523:3125</guid>
      <author>Sam Ruby</author>
      <link>http://forums.pragprog.com/forums/66/topics/523</link>
    </item>
    <item>
      <title>Confusion in iteration F4 (ch 11.4) posted by Jason Black @ Tue, 10 Jun 2008 17:46:12 -0000</title>
      <description>&lt;p&gt;The business about making the store layout the default layout for the application is sequenced oddly, in such a way as to generate some confusing errors that aren&amp;#8217;t mentioned in the text.&lt;/p&gt;


	&lt;p&gt;If the instructions are followed in the order that the book lists them, then when the user visits localhost:3000/users immediately after putting the layout &amp;#8220;store&amp;#8221; instruction in application.rb, you get a route error (or at least, I got a route error doing this on Windows).&lt;/p&gt;


	&lt;p&gt;The text should say to remove to unnecessary products.html.erb and users.html.erb &lt;span class="caps"&gt;BEFORE&lt;/span&gt; telling the user to go look at either of those controllers.&lt;/p&gt;


	&lt;p&gt;Also-&lt;del&gt;although I&amp;#8217;m sure you know this&lt;/del&gt;-the illustrations for that section need to be fixed because the browser screenshots in them show the wrong URLs, which was also quite confusing for me until I remembered the note at the front of the book saying not to trust the illustrations.&lt;/p&gt;</description>
      <pubDate>Tue, 10 Jun 2008 17:46:12 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:66:523:3117</guid>
      <author>Jason Black</author>
      <link>http://forums.pragprog.com/forums/66/topics/523</link>
    </item>
  </channel>
</rss>
