title: accepts_nested_attributes_for not working as expected for User model in Rails
body: <p>I'm getting the following error when trying to submit a nested attribute:</p>
  
  <pre><code>Can't mass-assign protected attributes: staff
  </code></pre>
  
  <p>My <code>User</code> model (created by Devise):</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    attr_accessible :name
    has_one :staff
    accepts_nested_attributes_for :staff, reject_if: :new_record?
  end
  </code></pre>
  
  <p>My Devise <code>registrations/edit.html.erb</code> view:</p>
  
  <pre><code>&lt;%= f.fields_for resource.staff do |s| %&gt;
    &lt;%= s.label :notification_email %&gt;
    &lt;%= s.email_field :notification_email, placeholder: 'Enter notification email' %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>What gets submitted in the HTML post as a parameter:</p>
  
  <pre><code>"user"=&gt;{"name"=&gt;"Scott",
  "staff"=&gt;{"notification_email"=&gt;"myemail@example.com"}}
  </code></pre>
  
  <p>I expected the HTML post parameter for staff to be <code>"staff_attributes"</code> rather than just <code>"staff"</code> based on the <a href="http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html" rel="nofollow">documentation for nested attributes</a>.</p>
  
  <p>Did I do something wrong? Do I really need to add <code>staff</code> to the <code>attr_accessible</code> list of attributes? Does this not work with Devise? I did have to use <code>resource</code> instead of <code>@user</code> in the view.</p>