title: Can't figure out where my routing error is coming from
body: <p>So I am trying to implement a polymorphic association for the first time and I'm running into a little bit of trouble. </p>
  
  <p>I am trying to allow users to leave a note on a contact or organization. But after I submit a note I run into a routing error. </p>
  
  <p><a href="https://i.stack.imgur.com/PMWz4.png" rel="nofollow noreferrer">Here is the error I'm receiving (image)</a></p>
  
  <p>Here are my <strong>routes</strong>:</p>
  
  <p><a href="https://i.stack.imgur.com/CnapS.png" rel="nofollow noreferrer">Here are my routes (screenshot)</a></p>
  
  <p>Here is my <strong>routes.rb</strong> file:</p>
  
  <pre><code>Rails.application.routes.draw do
    get 'welcome/index'
  
    resources :organizations do
      resources :contacts do 
        resources :notes, module: :contacts
      end
      resources :notes, module: :organizations
    end
  
    root 'welcome#index'
  end
  </code></pre>
  
  <p>Here is my <strong>notes_controller.rb</strong> file:</p>
  
  <pre><code>class NotesController &lt; ApplicationController
  
    def create
      @note = @noteable.notes.new note_params
  
      redirect_to @noteable, notice: "Your note was successful!!!"
    end
  
    private
  
    def note_params
      params.require(:note).permit(:note_title, :note_body)
    end
  end
  </code></pre>
  
  <p>Here is my <strong>contacts/notes_controller.rb</strong> file:</p>
  
  <pre><code>class Contacts::NotesController &lt; ApplicationController
  
    private
  
    def set_noteable
      @noteable = Contact.find(params[:contact_id])
    end
  end
  </code></pre>
  
  <p>Here is my <strong>oranizations/notes_controller.rb</strong> file:</p>
  
  <pre><code>class Organizations::NotesController &lt; ApplicationController
  
    private
  
    def set_noteable
      @noteable = Organization.find(params[:organization_id])
    end
  end
  </code></pre>
  
  <p>Here is my <strong>view/notes/_form.html.rb</strong> file:</p>
  
  <pre><code>&lt;h1&gt;New Note&lt;/h1&gt;
  &lt;%= form_for [noteable, Note.new] do |form| %&gt;
  
    &lt;p&gt;
      &lt;%= form.label :note_title %&gt;&lt;br&gt;
      &lt;%= form.text_field :note_title %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= form.label :note_body %&gt;&lt;br&gt;
      &lt;%= form.text_area :note_body %&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
      &lt;%= form.submit %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>If you need anything else, I will provide it! Thank you ahead of time!</p>