title: undefined method `model_name' for NilClass:Class (Using formtastic in Rails 3.0.3, Ruby 1.9.2)
body: <p>A tad bit confused as to why this isn't working. I'm using Ruby 1.9.2 with Rails 3.0.3 on Windows 7.</p>
  
  <p>Trying to make a form with formtastic for a post model, however, I keep getting <strong>undefined method `model_name' for NilClass:Class</strong> when I try to render the view.</p>
  
  <p>Relevant code:</p>
  
  <p>Demonly_controller.rb</p>
  
  <pre><code>class DemonlyController &lt; ApplicationController
      def index
        @post = Post.all
      end
  end
  </code></pre>
  
  <p>Posts_controller.rb</p>
  
  <pre><code>class PostsController &lt; ApplicationController
  
  end
  </code></pre>
  
  <p><em>Post.rb</em></p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
      attr_accessible :title, :post, :date, :time, :user, :visible, :comments
  end
  </code></pre>
  
  <p><em>Index.html.erb</em></p>
  
  <pre><code>&lt;h1&gt;Demonly&lt;/h1&gt;
  &lt;% semantic_form_for @post do |f|%&gt;
    &lt;%= f.errors %&gt;
    &lt;%= f.inputs do %&gt;
      &lt;%= f.input :title %&gt;
      &lt;%= f.input :post %&gt;
      &lt;%= f.input :date %&gt;
      &lt;%= f.input :time %&gt;
      &lt;%= f.input :user %&gt;
      &lt;%= f.input :visible %&gt;
      &lt;%= f.input :comments %&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>It's rather likely that I'm doing something very stupid seeing as I'm sick and mentally cloudy.</p>
  
  <p>Extracted source (around line #2):</p>
  
  <ol>
  <li>&lt;% semantic_form_for @post do |f|%></li>
  <li>&lt;%= f.errors %></li>
  <li>&lt;%= f.inputs do %></li>
  <li>&lt;%= f.input :title %></li>
  </ol>
  
  <p>Let me know if anything else is needed.</p>
  
  <p><strong>EDIT</strong>: Forgot to change some things back.</p>
  
  <p>Forgot to include the db schema:</p>
  
  <pre><code>create_table "posts", :force =&gt; true do |t|
      t.string   "title"
      t.text     "post"
      t.datetime "date"
      t.datetime "time"
      t.string   "user"
      t.boolean  "visible"
      t.boolean  "comments"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  </code></pre>