title: No route matches [POST] "/users/1/contacts/new"
body: <p>app/views/contacts/new.html.erb</p>
  
  <pre><code>&lt;h2&gt;Add New Contact&lt;/h2&gt;
  
      &lt;div class="row"&gt;
        &lt;div class="col-md-8"&gt;
        &lt;%= simple_form_for @contact, :url =&gt; new_user_contact_path do |f| %&gt;
          &lt;div class="form-group"&gt;
            &lt;%= f.label :first_name %&gt;
            &lt;%= f.text_field :first_name, class: "form-control" %&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;%= f.label :last_name %&gt;
            &lt;%= f.text_field :last_name, class: "form-control" %&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;%= f.input :date_of_birth, as: :date,  discard_year:true, order:[:day, :month] %&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;%= f.label :sex %&gt;
            &lt;%= f.select :sex, [:male, :female], class: "form-control" %&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;%= f.label :phone_number %&gt;
            &lt;%= f.text_field :phone_number, class: "form-control" %&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;%= f.label :address %&gt;
            &lt;%= f.text_area :address, class: "form-control" %&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;%= f.button :submit, "Submit", class: "btn btn-success btn-md btn-block" %&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;% end %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;%= link_to "Back", user_contacts_path %&gt;
  </code></pre>
  
  <p>My routes when I run <code>rake routes</code></p>
  
  <pre><code> Prefix Verb   URI Pattern                                 Controller#Action
              new_user_session GET    /users/sign_in(.:format)                    devise/sessions#new
                  user_session POST   /users/sign_in(.:format)                    devise/sessions#create
          destroy_user_session DELETE /users/sign_out(.:format)                   devise/sessions#destroy
                 user_password POST   /users/password(.:format)                   devise/passwords#create
             new_user_password GET    /users/password/new(.:format)               devise/passwords#new
            edit_user_password GET    /users/password/edit(.:format)              devise/passwords#edit
                               PATCH  /users/password(.:format)                   devise/passwords#update
                               PUT    /users/password(.:format)                   devise/passwords#update
      cancel_user_registration GET    /users/cancel(.:format)                     devise/registrations#cancel
             user_registration POST   /users(.:format)                            devise/registrations#create
         new_user_registration GET    /users/sign_up(.:format)                    devise/registrations#new
        edit_user_registration GET    /users/edit(.:format)                       devise/registrations#edit
                               PATCH  /users(.:format)                            devise/registrations#update
                               PUT    /users(.:format)                            devise/registrations#update
                               DELETE /users(.:format)                            devise/registrations#destroy
                 user_contacts GET    /users/:user_id/contacts(.:format)          contacts#index
                               POST   /users/:user_id/contacts(.:format)          contacts#create
              new_user_contact GET    /users/:user_id/contacts/new(.:format)      contacts#new
             edit_user_contact GET    /users/:user_id/contacts/:id/edit(.:format) contacts#edit
                  user_contact GET    /users/:user_id/contacts/:id(.:format)      contacts#show
                               PATCH  /users/:user_id/contacts/:id(.:format)      contacts#update
                               PUT    /users/:user_id/contacts/:id(.:format)      contacts#update
                               DELETE /users/:user_id/contacts/:id(.:format)      contacts#destroy
                         users GET    /users(.:format)                            users#index
                               POST   /users(.:format)                            users#create
                      new_user GET    /users/new(.:format)                        users#new
                     edit_user GET    /users/:id/edit(.:format)                   users#edit
                          user GET    /users/:id(.:format)                        users#show
                               PATCH  /users/:id(.:format)                        users#update
                               PUT    /users/:id(.:format)                        users#update
                               DELETE /users/:id(.:format)                        users#destroy
                         index GET    /index(.:format)                            redirect(301, /)
                          root GET    /                                           high_voltage/pages#show {:id=&gt;"index"}
                          page GET    /pages/*id                                  high_voltage/pages#show
  </code></pre>
  
  <p>config/routes.rb</p>
  
  <pre><code>Rails.application.routes.draw do
        devise_for :users
  
        resources :users do
          resources :contacts
        end
      end
  </code></pre>
  
  <p>My <code>new</code> and <code>create</code> action in <code>ContactsController</code></p>
  
  <pre><code>     def new
          @contact = Contact.new
        end
  
        def create
          @contact = Contact.new(contact_params)
          @contact.user = current_user
          if @contact.save
            flash[:success] = "Contact was successfully created!"
            redirect_to @contact.user
          else
            render :new
          end
        end
  </code></pre>
  
  <p>This is the issue:
  I get the error: <code>No route matches [POST] "/users/1/contacts/new"</code> when I submit the form at <a href="http://localhost:3000/users/1/contacts/new" rel="nofollow">http://localhost:3000/users/1/contacts/new</a>. What could be the issue?</p>