Devise authentication with email as usual, but forcing the user to put a name
<p>Well, to contextualize a bit, I want devise acts just like always, <strong>the only difference being that when a user sign up, he have to put a name (and it doesn't have to be blank)</strong></p>

<p>What I have achieved is that when the user sign up he can put a name, the problem is that he can leave it blank and his name will be equal to <code>""</code>.</p>

<p>I did this with some help of what appears on <a href="https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address" rel="nofollow">this</a> page, ie creating a migration to add the name column to the users table and putting the following in the application controller.</p>

<pre><code>class ApplicationController &lt; ActionController::Base
  before_action :configure_permitted_parameters, if: :devise_controller?
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :email, :password, :password_confirmation, :remember_me) }
    devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:name, :email, :password, :password_confirmation, :current_password) }
  end
end
</code></pre>

<p>But what is explained there later is not exactly what I want to do, I want the user to always sign in with his email (as devise already does by default), as I said, <strong>the only thing I wish is that if anyone wants to sign up, he have to type some name, being this not blank</strong>.</p>

<p>Does anyone know how can I do it?</p>