title: Rails 5 Simpleform not updating nested attributes
body: <p>Sorry I've looked at similar questions to this but still can't figure it out for some reason...</p>
  
  <p>I'm using Devise and I'm trying to update my User model and a City model at the same time (through the edit registrations page) using a nested form. </p>
  
  <p>I'm updating the users city based on a set of predefined values that are in the database. So all the user has to do is select a city they are living in from a list and then it save. </p>
  
  <p>All that happens at the moment is the form submits but the city isn't changed.</p>
  
  <p>Thanks in advance!</p>
  
  <pre><code>#user.rb
  class User &lt; ApplicationRecord
    belongs_to :city
  end
  
  #city.rb
  class City &lt; ApplicationRecord
    has_many :users
  end
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
    def index
      @users = User.all
    end
  
    def edit
      @user = User.find(params[:id])
    end
  
    def update
      @user = User.find(params[:id])
  
      if @user.update(user_params)
        redirect_to @user
      else
        render 'edit'
      end
    end
  
    def show
      @user = User.find(params[:id])
    end
  
    private
  
    def user_params
      params.require(:user).permit(city_attributes: [:id, :name, :user_id])
    end
  end
  </code></pre>
  
  <p>And my form:</p>
  
  <pre><code>&lt;%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %&gt;
  
        &lt;%= f.simple_fields_for :city do |c| %&gt;
  
        &lt;%= c.input :city_id, collection: City.all.order(name: :asc), label_method: :name, value_method: :id, label: "City", include_blank: false, selected: @user.city_id %&gt;
  
        &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>