title: Don't allow user to submit a form with empty fields in ruby on rails
body: <p>I am starting use Ruby on Rails and I am having a little problem. I have a form with 3 fields, this is the code: </p>
  
  <pre><code>&lt;%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %&gt;
    &lt;%= devise_error_messages! %&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.text_field :name, autofocus: true, placeholder: "Name" %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.email_field :email, autofocus: true, placeholder: "Email" %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.number_field :age, autofocus: true, placeholder: "Age" %&gt;
    &lt;/div&gt;
  
    &lt;div class="actions"&gt;
      &lt;%= f.submit "Sign up" %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>In the email field when you write something that is not an email and try to submit, the browser (chrome or firefox ) display an error saying that the field must content an @. The same happen with the age field, if a letter is entered the browser show an error saying that the field only accept numbers. </p>
  
  <p>I wanna know how to make that the browser show a message when any field is empty when you try to submit. I know how to do it in cakephp so I guess it can be done here in ruby too. I already validate the fields in the model, setting the presence in true but that only works for show a message after you submit and the page reload again.</p>