Rails Remote form validation errors not showing
<p>I have created an ajax form in Rails 4 using remote: true. For some reason that I'm missing, my validation errors are not showing in the form.</p>

<p>Here is my current codebase:</p>

<p><strong>1. Form</strong></p>

<pre><code>= simple_form_for @foo, url: foos_path, as: :foo, remote: true do |f|

  .row
    .input-field
      = f.input :bar

  .right-align.card-button
    = f.button :submit, class: "waves-light blue", data: { disable_with: "Loading..." }
</code></pre>

<p><strong>2. create.js.erb</strong></p>

<pre><code>$("#new_foo").html('&lt;%= j render_cell :foo, :form, foo: @foo %&gt;');
</code></pre>

<p><strong>3. Controller</strong></p>

<pre><code>def create
  @foo = FooForm.new( Foo.new )
  respond_to do |format|
    if @foo.validate(params[ :country ])
        @foo.save
        format.html { redirect_to root_path }
        format.json { render :show, status: :created, location: @foo.model }
        format.js 
    else
      format.html { render :new }
      format.json { render json: @foo.errors, status: :unprocessable_entity }
      format.js 
    end
  end
end
</code></pre>

<p>I would expect this code to show validation errors after a for being submitted incorrectly. Yet for some reason nothing happens after an incorrect submission. I can confirm that the form is being submitted however since the submission is processed in the log.I can also confirm that the form works perfectly fine when I remove remote submission.</p>

<p>Is there anything that I'm missing? </p>

<p>PS. I am using the <a href="https://github.com/apotonick/reform" rel="nofollow">Reform</a> gem which might make my controller object code seem a little bit unfamiliar to a lot of people. I am rendering a cell in my js file as per this <a href="https://github.com/apotonick/cells" rel="nofollow">gem</a></p>

<p><strong>UPDATE</strong>
I have struggled with this some more. I implemented a solution that I've copied a 'remote: true' solution that I've built in a previous app, verbatim. This worked flawlessly in my previous app but does not display validation errors in my new app. The only difference between these two apps are the version of Ruby and Rails.</p>

<p>In the first app I ran Ruby: 2.2.1 with Rails: 4.2.2. My new app ('the one that I can't get working') I'm running Ruby: 2.2.3 with Rails: 4.2.4.</p>

<p>Could this perhaps have an impact??</p>