title: errors not showing upon editing/updating an article - following rails guide v5.1.4
body: <p>This problem is specific to the example tutorials mentioned in the Getting Started guide of Rails 5.1.4</p>
  
  <p>Upon following <a href="http://guides.rubyonrails.org/getting_started.html#updating-articles" rel="nofollow noreferrer">Section 5.11 [Updating Articles]</a> from the rails getting started guide, it is expected that the line containing <code>&lt;% if @article.errors.any? %&gt;</code> in the <code>app/views/articles/edit.html.erb</code> file will get invoked if an article with empty title or empty text are tried to be saved. Meaning, the error messages should show up. </p>
  
  <p>However, the article is prevented from getting updated (as expected) but the error messages do not show up (as not expected).</p>
  
  <p>Is anyone familiar with this problem from the getting started tutorials explained in Rails Guide 5.1.4 ?</p>
  
  <hr>
  
  <p>EDIT::: Following are the controller file and the view file. I have added some <code>puts</code> statements to print to the console</p>
  
  <p>The <code>articles_controller,rb</code> file:</p>
  
  <pre><code>def edit
    @article = Article.find(params[:id])
  end
  
  def update
    @article = Article.find(params[:id])
    if @article.update(valid_article_params)
      puts 'article successfully updated...'
      redirect_to @article
    else
      puts 'article could not be updated...'
      render 'edit'
    end
  end
  
  private
    def valid_article_params
      params.require(:article).permit(:title, :text)
    end
  </code></pre>
  
  <p>The <code>edit.html.erb</code> file:</p>
  
  <pre><code>&lt;h1&gt;Edit article&lt;/h1&gt;
  &lt;%= form_with(model: @article) do |form| %&gt;
  
    &lt;% if @article.errors.any? %&gt;
      &lt;% puts 'there are some errors here in edit.html.erb' %&gt;
      &lt;div id="error_explanation"&gt;
        &lt;h3&gt;
          &lt;%= pluralize(@article.errors.count, "error") %&gt; prohibited this article from being saved:
        &lt;/h3&gt;
        &lt;ul&gt;
          &lt;% @article.errors.full_messages.each do |msg| %&gt;
            &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
          &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;% puts 'errors shown from edit.html.erb' %&gt;
    &lt;% end %&gt;
  
    &lt;p&gt;
      &lt;%= form.label :title %&gt;&lt;br&gt;
      &lt;%= form.text_field :title %&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
      &lt;%= form.label :text %&gt;&lt;br&gt;
      &lt;%= form.text_area :text %&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
      &lt;%= form.submit %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  
  &lt;%= link_to 'Back', articles_path %&gt;
  </code></pre>