title: ActionView::Template::Error undefined method
body: <p>I am following <a href="http://www.headfirstlabs.com/books/hfrails/" rel="nofollow noreferrer">Head First Rails</a> which has been written for older version of rails. I am working on its chapter 2 project but in Rails 3. Following are my files.</p>
  <p>ads_controller.rb</p>
  <pre><code>class AdsController &lt; ApplicationController
    def show
      @ad = Ad.find(params[:id])
    end
  
    def index
      @ads = Ad.find(:all)
    end
  end
  </code></pre>
  <p>ad.rb</p>
  <pre><code>class Ad &lt; ActiveRecord::Base
    attr_accessible :description, :email, :img_url, :name, :price, :seller_id
  end
  </code></pre>
  <p>index.html.rb</p>
  <pre><code>&lt;/h1&gt;
  &lt;ul&gt;
  &lt;% for ad in @ads %&gt;
    &lt;li&gt;&lt;a href=&quot;/ads/&lt;%= ad.id %&gt;&quot;&gt;&lt;%= ad.name %&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;% end %&gt;
  &lt;/ul&gt;
  </code></pre>
  <p>show.html.rb</p>
  <pre><code>&lt;body&gt;
      &lt;p&gt;
          &lt;b&gt;Name:&lt;/b&gt;&lt;%= @ad.name %&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;b&gt;Description:&lt;/b&gt;&lt;%= @ad.desciption %&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;b&gt;Price:&lt;/b&gt;&lt;%= @ad.price %&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;b&gt;Seller Id:&lt;/b&gt;&lt;%= @ad.seller_id %&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;b&gt;Email:&lt;/b&gt;&lt;%= @ad.email %&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;img src=&quot;&lt;%= @ad.img_url %&gt;&quot;/&gt;
      &lt;/p&gt;
  &lt;/body&gt;
  </code></pre>
  <p>schema.rb</p>
  <pre><code>ActiveRecord::Schema.define(:version =&gt; 20121209174120) do
  
    create_table &quot;ads&quot;, :force =&gt; true do |t|
      t.string   &quot;name&quot;
      t.text     &quot;description&quot;
      t.decimal  &quot;price&quot;
      t.integer  &quot;seller_id&quot;
      t.string   &quot;email&quot;
      t.string   &quot;img_url&quot;
      t.datetime &quot;created_at&quot;,  :null =&gt; false
      t.datetime &quot;updated_at&quot;,  :null =&gt; false
    end
  
  end
  </code></pre>
  <p>Database is populated for all the fields. <code>http://0.0.0.0:3000/ads/</code> works but <code>http://0.0.0.0:3000/ads/&lt;any number&gt;</code> does not work and throws the following error:</p>
  <p>NoMethodError in Ads#show</p>
  <pre><code>Showing /Users/ava/Projects/mebay/app/views/ads/show.html.erb where line #6 raised:
  
  undefined method `desciption' for #&lt;Ad:0x007f7ff346c100&gt;
  
  Extracted source (around line #6):
  
  3:      &lt;b&gt;Name:&lt;/b&gt;&lt;%= @ad.name %&gt;
  4:  &lt;/p&gt;
  5:  &lt;p&gt;
  6:      &lt;b&gt;Description:&lt;/b&gt;&lt;%= @ad.desciption %&gt;
  7:  &lt;/p&gt;
  8:  &lt;p&gt;
  9:      &lt;b&gt;Price:&lt;/b&gt;&lt;%= @ad.price %&gt;
  
  Rails.root: /Users/ava/Projects/mebay
  Application Trace | Framework Trace | Full Trace
  
  app/views/ads/show.html.erb:6:in `_app_views_ads_show_html_erb___4217851794431988162_70093760484140'
  </code></pre>
  <p>On server window:</p>
  <pre><code>ActionView::Template::Error (undefined method `desciption' for #&lt;Ad:0x007f7ff346c100&gt;):
      3:      &lt;b&gt;Name:&lt;/b&gt;&lt;%= @ad.name %&gt;
      4:  &lt;/p&gt;
      5:  &lt;p&gt;
      6:      &lt;b&gt;Description:&lt;/b&gt;&lt;%= @ad.desciption %&gt;
      7:  &lt;/p&gt;
      8:  &lt;p&gt;
      9:      &lt;b&gt;Price:&lt;/b&gt;&lt;%= @ad.price %&gt;
    app/views/ads/show.html.erb:6:in `_app_views_ads_show_html_erb___4217851794431988162_70093760484140'
  </code></pre>
  <p>If I remove description in show.html.rb then it works fine and displays name, price, seller_id and email. What am I doing wrong?</p>
  <p>Ruby version: <code>ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.4.0]</code>
  Rails version: <code>Rails 3.2.7</code></p>
  <p>Thanks.</p>