As I know, devise has validation only for email and password, which can be reconfigurated in initializer devise.rb:
# ==> Configuration for :validatable
# Range for password length. Default is 6..128.
# config.password_length = 6..128
# Regex to use to validate the email address
# config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
How add validation for custom fields, which has been added into invitation form of devise_invitable?
For example, I need validation for the first_ and the last_ names in the form:
= simple_form_for resource, :as => resource_name, :url => invitation_path(resource_name) do |f|
= f.input :first_name
= f.input :last_name
= f.input :email
= f.button :submit
Thanks in advance!