title: default form_with NOT remote nor expecting to respond via JS
body: <p>Class <code>shop</code></p>
  <pre><code>  accepts_nested_attributes_for :shopzones, allow_destroy: true
  </code></pre>
  <p>while the shops_controller defines the action and attempts to define the strong parameters</p>
  <pre><code>def shopzone
    @shopzone = Shopzone.new
    @shopzone.save
  end
  
  def shopzone_params  # in addition to the def shop_params method
    params.require(:shopzone).permit(:shop_id, :name, :sequence, :area)
  end
  </code></pre>
  <p>A form</p>
  <pre><code> &lt;%= form_with url: shopzone_shop_path(id: @shop.id) do |f| %&gt;
      &lt;%= f.hidden_field 'shopzone[shop_id]', value: @shop.id %&gt;
      &lt;div class='grid-x grid-padding-x'&gt;
        &lt;div class='cell small-3 alert'&gt;
          &lt;%= t('name') %&gt;
          &lt;%= f.text_field 'shopzone[name]' %&gt;
          &lt;%= t('sequence') %&gt;:
          &lt;%= f.number_field 'shopzone[sequence]' %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class='grid-x grid-padding-x'&gt;
        &lt;div class='cell small-12 text-center'&gt;
          &lt;%= f.submit t('create'), class: 'button' %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  </code></pre>
  <p>But it does not render <code>data-remote=&quot;true&quot;</code> as is expected by default.</p>
  <pre><code>&lt;form action=&quot;/shops/3/shopzone&quot; accept-charset=&quot;UTF-8&quot; method=&quot;post&quot;&gt;
  </code></pre>
  <p>Upon submission the parameters are logged but towards an expected HTML response</p>
  <pre><code>Processing by ShopsController#shopzone as HTML
    Parameters: {&quot;authenticity_token&quot;=&gt;&quot;[FILTERED]&quot;, &quot;shopzone&quot;=&gt;{&quot;shop_id&quot;=&gt;&quot;3&quot;, &quot;name&quot;=&gt;&quot;central&quot;, &quot;sequence&quot;=&gt;&quot;1&quot;
  </code></pre>
  <p>If the form is edited to</p>
  <pre><code>&lt;%= form_with(url: shopzone_shop_path(id: @shop.id), local: false) do |f| %&gt;
  </code></pre>
  <p>then the  data-remote renders</p>
  <pre><code>&lt;form action=&quot;/shops/3/shopzone&quot; accept-charset=&quot;UTF-8&quot; data-remote=&quot;true&quot; method=&quot;post&quot;&gt;
  </code></pre>
  <p>However, the server response is still expecting to handle HTML</p>
  <pre><code>Processing by ShopsController#shopzone as HTML
  [...]
  ActionController::UnknownFormat (ShopsController#shopzone is missing a template for this request format and variant.
  
  request.formats: [&quot;text/html&quot;]
  </code></pre>
  <p>Thus the first oddity is rails' purported default behaviour not kicking in?<br />
  If the controlelr action is appended with</p>
  <pre><code>respond_to do |format|
    format.js
  end
  </code></pre>
  <p>The process runs</p>
  <pre><code>Started POST &quot;/shops/3/shopzone&quot; for ::1 at 2021-06-11 10:34:28 +0200
  Processing by ShopsController#shopzone as JS
    Parameters: {&quot;authenticity_token&quot;=&gt;&quot;[FILTERED]&quot;, &quot;shopzone&quot;=&gt;{&quot;shop_id&quot;=&gt;&quot;3&quot;, &quot;name&quot;=&gt;&quot;central&quot;, &quot;sequence&quot;=&gt;&quot;1&quot; [...]
  </code></pre>
  <p>but then complains about the validations which exist on the model</p>
  <pre><code>ActiveRecord::RecordInvalid (Validation failed: Shop must exist, Sequence can't be blank, Name can't be blank):
  </code></pre>
  <p>which is contrary to the parameters submitted.  Inspecting the params in the action before save <code>puts    @shopzone.inspect</code>  effectively returns nil params.</p>
  <p>Thus something about the nested attributes is throwing default behaviours off.</p>
  <p>What is best course to process the request as unobtrusive JS ?</p>