title: Rails 7 failed save only shows errors if I render with a status
body: <p>I've been working with rails for a while, but I thought I'd try a course to cement my knowledge.</p>
  <p>But I already get stumped on a basic save/error action.</p>
  <p>I am trying to show error messages after model validation fails.</p>
  <p>If the model validation fails, I <code>render 'new'</code>again, where the model instance should have error messages. But if I try to print the error messages like <code>&lt;%= modelinstance.errors.inspect %&gt;</code> it just shows an empty array.</p>
  <p>The weird thing is, if I instead do <code>render :new, status: :unprocessable_entity</code> it gladly renders the whole error thing.</p>
  <p>I was just wondering why this is the case, when the ruby on rails guide is allowing the string version.</p>
  <p>Controller:</p>
  <pre><code>...
  def index
      articles = Article.all
  
      render locals: {
          articles: articles
      }
  end
  
  def new
      @article = Article.new
  end
  
  def create
      @article = Article.new(article_params)
  
      if @article.save
          redirect_to @article
      else
          render :new, status: :unprocessable_entity
      end
  
  end
  ...
  </code></pre>
  <p>View:</p>
  <pre><code>&lt;h1&gt;Create a new article&lt;/h1&gt;
  
  &lt;% if @article.errors.any? %&gt;
      &lt;h2&gt;The following errors prevented the article from saving:&lt;/h2&gt;
      &lt;% @article.errors.full_messages.each do |msg| %&gt;
          &lt;%= msg %&gt;
      &lt;% end %&gt;
  &lt;% end %&gt;
  
      ...
      &lt;%= form_with scope: @article, url: articles_path, local: true do |f| %&gt;
          &lt;p&gt;
              &lt;%= f.label :title %&gt;
              &lt;%= f.text_field :title %&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;%= f.label :description %&gt;
              &lt;%= f.text_area :description %&gt;
          &lt;/p&gt;
          &lt;p&gt;
           &lt;%= f.submit %&gt;
          &lt;/p&gt;
      &lt;% end %&gt;'
      ...
  </code></pre>