Rails Simple_form show form validation errors on load the form
<p>Well i am new to rails and i'm trying to make a form inside a modal at the index action which is working great except on opening this modal i find all the required inputs in the form colored in red , which is confusing because i didn't clicked the submit button yet to check for validation as you can see in the screenshot , so what i'm doing wrong here ? any help is appreciated </p>

<p><a href="https://i.stack.imgur.com/R5r1n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5r1n.png" alt="this is the modal form"></a></p>

<p>this is the modal partial in the index.html.erb</p>

<pre><code>&lt;%= render 'popup' %&gt;
</code></pre>

<p>here is _popup.html.erb</p>

<pre><code>&lt;% content_for :popup do %&gt;
&lt;%- model_class = Supplier -%&gt;
 &lt;div class="modal splash fade" id="splash" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
&lt;div class="modal-dialog"&gt;
  &lt;div class="modal-content"&gt;
    &lt;div class="modal-header"&gt;
      &lt;h1&gt;&lt;%= t '.title', :default =&gt; model_class.model_name.human.titleize %&gt;&lt;/h1&gt;
    &lt;/div&gt;
    &lt;div class="modal-body"&gt;
      &lt;%= render 'form' %&gt;
    &lt;/div&gt;           
  &lt;/div&gt;
&lt;/div&gt;
 &lt;/div&gt;
 &lt;% end %&gt;
</code></pre>

<p>this is the _form.htm.erb</p>

<pre><code>&lt;%= simple_form_for(@supplier ,remote: true) do |f| %&gt; 
 &lt;div class="form-inputs"&gt;
  &lt;%= f.input :name %&gt;
  &lt;%= f.input :code %&gt;
  &lt;%= f.input :email , :hint =&gt; "should be a valid email "%&gt;
  &lt;%= f.input :status %&gt;
  &lt;%= f.input :total_credit %&gt;
  &lt;%= f.input :user_id,collection: [] || User.all ,label_method: :name , value_method: :id ,include_blank: true %&gt;
  &lt;%= f.input :notes %&gt;
 &lt;/div&gt;
 &lt;div class="modal-footer"&gt;
   &lt;%= f.button :submit %&gt;
 &lt;/div&gt;
&lt;% end %&gt;
</code></pre>

<p>and the controller action :index</p>

<pre><code>def index
 @suppliers  = Supplier.all
 @supplier   = Supplier.new
end
</code></pre>

<p>here is my model :</p>

<pre><code>class Supplier &lt; ActiveRecord::Base

has_many :supplier_branches
has_many :supplier_phones
has_many :supplier_contacts
has_many :purchase_invoices
belongs_to :user

validates :name,:code, presence: true
validates :email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }

end
</code></pre>