title: is missing a template for request formats: text/html
body: <blockquote>
  <p>I have Term and Phrase models and I am adding Nested Resources. I want to get the Term Id for Phraes_term to create a data pair</p>
  <p>Example: Term 1 and Phrase 2.
  But when you press the new button from show.html.erb term, an error will occur</p>
  </blockquote>
  <pre><code>--&gt;error :PhrasesTermsController#new is missing a template for request formats: text/html
  </code></pre>
  <p>form.html.erb
  -(phrases_term).</p>
  <pre><code>&lt;%= form_with(model: phrases_term, local: true) do |form| %&gt;
    &lt;% if pharases_term.errors.any? %&gt;
      &lt;div id=&quot;error_explanation&quot;&gt;
        &lt;h2&gt;&lt;%= pluralize(pharases_term.errors.count, &quot;error&quot;) %&gt; prohibited this phrase from being saved:&lt;/h2&gt;
  
        &lt;ul&gt;
        &lt;% pharases_term.errors.full_messages.each do |message| %&gt;
          &lt;li&gt;&lt;%= message %&gt;&lt;/li&gt;
        &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  
    &lt;div class=&quot;field&quot;&gt;
      &lt;%= form.label :ID %&gt;
      &lt;%= form.number_field_tag :ID %&gt;
    &lt;/div&gt;
  
    &lt;div class=&quot;actions&quot;&gt;
      &lt;%= form.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  <p>(phrases_term)
  -new.html.erb</p>
  <pre><code>&lt;%= render 'form', phrases_term: @phrases_term %&gt;
  </code></pre>
  <p>Phrases_terms_controller.rb</p>
  <pre><code>class PhrasesTermsController &lt; ApplicationController
    before_action :authenticate_user!
    before_action :set_term
  
    def new
      @phrases_term = PhrasesTerm.new
    end
  
    def create
      @phrases_term = @term.phrases_term
      @phrases_term.user = current_user
      @phrases_term.save
      redirect_back(fallback_location: root_path)
    end
    
    private
    
    def phrases_term_params
      params.require(:phrases_term).permit(:term_id)
    end
  
    def set_term
      @term = Term.find(params[:term_id])
    end
  end
  
  </code></pre>
  <p>routes.rb</p>
  <pre><code>resources :terms do
      resources :phrases_terms, only: [:create, :destroy, :new]
    end
  </code></pre>
  <p>(Term)
  Show.html.erb</p>
  <pre><code>&lt;td&gt;&lt;%= link_to 'New', new_term_phrases_term_path(@term) %&gt;&lt;/td&gt;
  </code></pre>
  <pre><code>(phrases_term).
  
  _form.html.ebr
  &lt;%= form_with(model: phrases_term, local: true) do |form| %&gt;
    &lt;% if pharases_term.errors.any? %&gt;
      &lt;div id=&quot;error_explanation&quot;&gt;
        &lt;h2&gt;&lt;%= pluralize(pharases_term.errors.count, &quot;error&quot;) %&gt; prohibited this phrase from being saved:&lt;/h2&gt;
  
        &lt;ul&gt;
        &lt;% pharases_term.errors.full_messages.each do |message| %&gt;
          &lt;li&gt;&lt;%= message %&gt;&lt;/li&gt;
        &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  
    &lt;div class=&quot;field&quot;&gt;
      &lt;%= form.label :ID %&gt;
      &lt;%= form.number_field_tag :ID %&gt;
    &lt;/div&gt;
  
    &lt;div class=&quot;actions&quot;&gt;
      &lt;%= form.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  <pre><code>(phrases_term)
   new.html.erb
  &lt;%= render 'form', phrases_term: @phrases_term %&gt;
  </code></pre>