<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in 'undefined method `title'' | Pragmatic Forums</title>
    <link>http://forums.pragprog.com/forums/22/topics/325</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <description></description>
    <item>
      <title>undefined method `title' posted by David Kiely @ Wed, 21 May 2008 20:34:59 -0000</title>
      <description>&lt;p&gt;I was seeing undefined method `title&amp;#8217; when I accessed the page products/new&lt;br /&gt;It was raised by products/new.html.erb on line #8&lt;br /&gt;I have been following the 3rd edition of &lt;span class="caps"&gt;AWDWR&lt;/span&gt; and have noticed many differences between the book and what happens in the code.&lt;br /&gt;The problem here was that title wasn&amp;#8217;t a column in my database.&lt;/p&gt;


	&lt;p&gt;so I would check my tables and check the spelling again.&lt;/p&gt;</description>
      <pubDate>Wed, 21 May 2008 20:34:59 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:22:325:2861</guid>
      <author>David Kiely</author>
      <link>http://forums.pragprog.com/forums/22/topics/325</link>
    </item>
    <item>
      <title>undefined method `title' posted by Tim Wolak @ Wed, 19 Mar 2008 18:25:11 -0000</title>
      <description>&lt;p&gt;I am working on the depot store and on page 85 after you enter in the code for checking the title uniqueness my code fails with udefined method &amp;#8216;title&amp;#8217;.  Has anyone seen this before?&lt;/p&gt;


	&lt;p&gt;Tim&lt;/p&gt;


	&lt;p&gt;class Product &amp;lt; ActiveRecord::Base
        validates_presence_of :title, :description, :image_url
        validates_numericality_of :price
        validates_uniqueness_of :title
        validates_format_of :image_url,
                        :with    =&amp;gt; %r{\.(gif|jpg|png)$}i,
                        :message =&amp;gt; &amp;#8220;must be a &lt;span class="caps"&gt;URL&lt;/span&gt; for a &lt;span class="caps"&gt;GIF&lt;/span&gt;, JPG or &lt;span class="caps"&gt;PNG&lt;/span&gt; image&amp;#8221; &lt;br /&gt;protected&lt;br /&gt;def validate
        errors.add(:price, &amp;#8220;should be at least 0.01&amp;#8221;) if price.nil? || price &amp;lt; 0.01&lt;br /&gt;end&lt;br /&gt;end&lt;/p&gt;</description>
      <pubDate>Wed, 19 Mar 2008 18:25:11 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:22:325:2464</guid>
      <author>Tim Wolak</author>
      <link>http://forums.pragprog.com/forums/22/topics/325</link>
    </item>
  </channel>
</rss>
