title: undefined method `key?' for nil:NilClass
body: <p>I'm new to Rails and was following Ryan Bate's tutorial on how to make a simple authentication system (<a href="http://railscasts.com/episodes/250-authentication-from-scratch?autoplay=true">http://railscasts.com/episodes/250-authentication-from-scratch?autoplay=true</a>) and I was just going through it but got this error: `</p>
  
  <pre><code>NoMethodError in UsersController#new
  
  undefined method `key?' for nil:NilClass
  Rails.root: C:/Sites/authentication`
  </code></pre>
  
  <p>I don't really know what this means since I'm just a beginner, but these are my files:</p>
  
  <p>users controller:  </p>
  
  <pre><code>class UsersController &lt; ApplicationController
    def new
      @user = User.new
    end
  
    def create
      @user = User.new(params[:user])
      if @user.save
          redirect_to root_url, :notice =&gt; "Signed up!"
      else
          render "new"
      end
    end
  end
  </code></pre>
  
  <p>new.html.erb:</p>
  
  <pre><code>    &lt;%= form for @user do |f| %&gt;
  &lt;% if @user.errors.any? %&gt;
  &lt;div class="error_messages"&gt;
      &lt;h2&gt;Form is invalid&lt;/h2&gt;
      &lt;ul&gt;
          &lt;% for message in @user.errors.full_messages %&gt;
          &lt;li&gt;&lt;%= message %&gt;&lt;/li&gt;
          &lt;% end %&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  &lt;p&gt;
      &lt;%= f.label :email %&gt;
      &lt;%= f.text_field :email %&gt;
  &lt;/p&gt;
  &lt;p&gt;
      &lt;%= f.label :password %&gt;
      &lt;%= f.password_field :password %&gt;
  &lt;/p&gt;
  &lt;p&gt;
      &lt;%= f.label :password_confirmation %&gt;
      &lt;%= f.password_field :password_confirmation %&gt;
  &lt;/p&gt;
  &lt;p class="button"&gt;&lt;%= f.submit %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>routes.rb</p>
  
  <pre><code>    Authentication::Application.routes.draw do
    get "sign_up" =&gt; "users#new", :as =&gt; "sign_up"
    root :to =&gt; "users#new"
    resources :users
   end
  </code></pre>
  
  <p>user model</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
      attr_accessor :password
      before_save :encrypt_password
  
      validates_confirmation_of :password
      validates_presence_of :password, :on =&gt; create
      validates_presence_of :email
      validates_uniqueness_of :email
  
      def encrypt_password
          if password.present?
              self.password_salt = BCrypt::Engine.generate_salt
              self.password_hash = BCrypt::Engine.hash_secrete(password, password_salt)
      end
  end
  </code></pre>
  
  <p>I think the tutorial was made for Rails 3.1 or some version of rails 3. But I am using Rails 3.2, that might be part of the problem. But since I'm a beginner I have no idea what is going on. Could someone tell me what to do?</p>
  
  <p>Thanks</p>