title: Rails Remote True Ajax ActionController::UnknownFormat
body: <p>I have a mini-update method in my model that only updates one field, set up in a chart (so I see the form for each row).  It works properly, but want it to update using AJAX to be able to do multiple updates quickly without waiting for a full page reload.</p>
  
  <p>The cell looks like this:</p>
  
  <pre><code>      &lt;td style="min-width: 150px" id="goody_cell&lt;%= blog.id %&gt;"&gt;
          &lt;%= render partial: "admin/goody_cell", locals: { blog: blog } %&gt;
        &lt;/td&gt;
  </code></pre>
  
  <p>With this as the partial:</p>
  
  <pre><code>&lt;% if blog.variation_id %&gt;
    &lt;%= Variation.find(blog.variation_id).name %&gt;
  &lt;% end %&gt;
  
  &lt;%= simple_form_for(blog, url: update_goody_path(blog), remote: true, method: :patch, authenticity_token: true) do |f| %&gt;
    &lt;% variation_collection = [] %&gt;
    &lt;% Variation.all.each do |lm| %&gt;
      &lt;% variation_collection &lt;&lt; ["#{lm.name}", "#{lm.id}"] %&gt;
    &lt;% end %&gt;
    &lt;div class="row text-left"&gt;
      &lt;div class="form-group col-12 mb-0 pb-0"&gt;
        &lt;%= f.input :variation_id, label: false, prompt: "Choose a Related Goody", input_html: { id: "lmFor" + blog.id.to_s, class: 'browser-default', onchange: "this.form.submit();" }, collection: variation_collection, required: false %&gt;
      &lt;/div&gt;
    &lt;/div&gt; &lt;!-- row --&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>My <code>blogs/update_goody.js.erb</code> looks like this:</p>
  
  <pre><code>$('#goody_cell&lt;%= blog.id %&gt;').html('&lt;%= j render partial: "admin/goody_cell", locals: { blog: @blog } %&gt;');
  </code></pre>
  
  <p>And my controller method is like this:</p>
  
  <pre><code>  def update_goody
      @blog = Blog.friendly.find(params[:id])
      if @blog.update!(blog_params)
        respond_to do |format|
          format.js
        end
      else
        format.html { render :edit }
        format.json { render json: @blog.errors, status: :unprocessable_entity }
      end
    end
  </code></pre>
  
  <p>I have the route like this:</p>
  
  <pre><code>patch "blogs/:id/update_goody" =&gt; "blogs#update_goody", as: "update_goody"
  </code></pre>
  
  <p>When I try to update it, it does update the value, but before it renders the partial, I get an error saying:</p>
  
  <pre><code>ActionController::UnknownFormat - ActionController::UnknownFormat:
    app/controllers/blogs_controller.rb:178:in `update_goody'
  </code></pre>
  
  <p>I've looked at SO posts like <a href="https://stackoverflow.com/questions/36590757/respond-to-js-unknown-format">this</a> but they all say that the error was fixed by adding <code>remote: true</code>, which I already have.</p>
  
  <p>Can anyone help me get this working?</p>