title: Undefined method in devise user model
body: <p>I'm fairly new to rails and trying to add a belongs_to association to my Devise User model.
  The error I get when trying to render the view:</p>
  
  <p>NoMethodError in Devise/registrations#edit
  undefined method `department_id' for #</p>
  
  <p>This error is occurring on the collection_select in my view. Isn't this method provided by the belongs_to association?</p>
  
  <p>User model</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :token_authenticatable, :confirmable, :lockable and :timeoutable
    devise :invitable, :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable
  
    # Setup accessible (or protected) attributes for your model
    attr_accessible :email, :password, :password_confirmation, :remember_me
  
    belongs_to :department
  end
  </code></pre>
  
  <p>Edit view</p>
  
  <pre><code>%h2
    Edit #{resource_name.to_s.humanize}
  = form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :html =&gt; { :method =&gt; :put }) do |f|
    = devise_error_messages!
    %p
      = f.label :email
      %br/
      = f.text_field :email
    %p
      = f.label :department
      %br/
      = collection_select(resource_name, :department_id, Department.all, :id, :name)
    %p
      ...
  </code></pre>