title: Fields_for not saving data on update
body: <p>I'm trying to do the edit action for my users with fields_for.
  The problem is it wont save the pro params in User. It wont update the pro attributes.</p>
  
  <p>I have 2 models, <code>pro</code> and `user``</p>
  
  <p>User <code>has_one</code> pro, and pro <code>belongs_to</code> user.</p>
  
  <p><strong>In the user model</strong>, I've put: <code>accepts_nested_attributes_for :pro, allow_destroy: true</code></p>
  
  <p><strong>In the users controller, I've put:</strong></p>
  
  <pre><code>def user_params
      params.require(:user).permit(:name, :pro, :tos_agreement, :avatar,
                                   :avatar_cache, :is_pro,:email, :password,
                                   :password_confirmation,
                                   pro_attributes: [
                                     :type, :pro_name, :is_pro, :pro_image,
                                     :is_active, :web, :user_id, :about,
                                     :facebook, :twitter, :linkedin, :telephone])
    end
  
    def edit
      @user = User.friendly.find(params[:id])
    end
  
    def update
      @user = User.friendly.find(params[:id])
      pro = @user.build_pro
    end
  </code></pre>
  
  <p><strong>And finally, in my edit.html.erb view, I've added to the form:</strong></p>
  
  <pre><code>     &lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :html =&gt; { :method =&gt; :put }) do |f| %&gt;
      &lt;ul class="accordion-submenu"&gt;
        &lt;li class="semi_padding"&gt;
            &lt;%= f.label :nombre %&gt;
            &lt;%= f.text_field :name, :autofocus =&gt; true %&gt;
            &lt;%= f.label :email %&gt;
            &lt;%= f.email_field :email %&gt;
            &lt;%= f.label "Algo sobre tí" %&gt;
            &lt;%= f.text_field :description, placeholder: "Soy una persona amante de la decoración..." %&gt;
            &lt;%= f.label "Lugar" %&gt;
            &lt;%= f.text_field :location , placeholder: "¿De donde eres? Ej: Bilbao"%&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href="javascript:void(0)" class="js-accordion-trigger"&gt;
      &lt;i class="icon-switch"&gt; &lt;/i&gt; Contraseña&lt;/a&gt;
      &lt;ul class="accordion-submenu"&gt;
        &lt;li class="semi_padding"&gt;
          &lt;%= f.label :contraseña %&gt;
          &lt;%= f.password_field :password, :autocomplete =&gt; "off" %&gt;
          &lt;%= f.label "Confirmación de contraseña" %&gt;
          &lt;%= f.password_field :password_confirmation %&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;% if @user.has_role :pro %&gt;
     &lt;li&gt;
      &lt;a href="javascript:void(0)" class="js-accordion-trigger"&gt;
      &lt;i class="icon-store"&gt; &lt;/i&gt; Datos de marca PRO&lt;/a&gt;
      &lt;ul class="accordion-submenu"&gt;
        &lt;li class="semi_padding"&gt;
         &lt;%= fields_for @user.pro do |builder| %&gt;
          &lt;%= builder.label :facebook %&gt;
          &lt;%= builder.text_field :facebook, placeholder: "Facebook URL" %&gt;
          &lt;%= builder.label :twitter %&gt;
          &lt;%= builder.text_field :twitter,  placeholder: "Twitter URL" %&gt;
          &lt;%= builder.label :linkedin %&gt;
          &lt;%= builder.text_field :linkedin,  placeholder: "Linkedin URL"%&gt;
        &lt;% end %&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;% end %&gt;
  </code></pre>
  
  <p>I can see the params are in the logs, but, they don't get saved. Any advice? Thanks!</p>
  
  <p>UPDATE:</p>
  
  <pre><code>Started PUT "/users" for 127.0.0.1 at 2015-01-29 19:25:17 +0100
  Processing by RegistrationsController#update as HTML
    Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"+6D1uzTbQioSLgcxgnMEJOw1ADTgId8LUrCCwiQXpcg=", "user"=&gt;{"avatar_cache"=&gt;"", "name"=&gt;"User 5", "email"=&gt;"prueba5@prueba.com", "description"=&gt;"Et doloremque repudiandae alias odit quis rerum.", "location"=&gt;"Bilbao", "password"=&gt;"[FILTERED]", "password_confirmation"=&gt;"[FILTERED]"}, "pro"=&gt;{"facebook"=&gt;"TESTTTTTTT", "twitter"=&gt;"TESTTTTTTT", "linkedin"=&gt;"TESTTTTTTT"}, "commit"=&gt;"Modificar"}
    User Load (0.9ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 6 ORDER BY "users"."id" ASC LIMIT 1
    Notification Load (0.3ms)  SELECT "notifications".* FROM "notifications" WHERE "notifications"."user_id" = $1 AND "notifications"."viewed_at" IS NULL ORDER BY "notifications"."created_at" DESC LIMIT 30  [["user_id", 6]]
    Notification Load (0.2ms)  SELECT "notifications".* FROM "notifications" WHERE "notifications"."user_id" = $1 AND (viewed_at IS NOT NULL) ORDER BY "notifications"."created_at" DESC LIMIT 30  [["user_id", 6]]
    User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1  [["id", 5]]
    User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1  [["id", 7]]
    User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1  [["id", 6]]
    User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 6]]
     (0.1ms)  BEGIN
     (0.1ms)  COMMIT
  Redirected to http://localhost:3000/
  Completed 302 Found in 23ms (ActiveRecord: 2.2ms)
  </code></pre>