Ruby on Rails を使用してログイン フォームを作成しています。ログインしようとしたり、新しいアカウントを作成したりすると、このクライアント側エラーが発生し、フォームを POST できなくなります。
これは、フォーム View を生成するために使用している Ruby コードです。
#account-form
h2 Create your free account!
p Signing up is completely free and you can use all of our features.
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= f.error_notification
.form-group
= f.label :email
= f.input_field :email, class: 'form-control'
.form-group
= f.label :password
= f.input_field :password, required: true, class: 'form-control'
.form-group
= f.label :password_confirmation
= f.input_field :password_confirmation, require: true, class: 'form-control'
button.btn.btn-default type='submit' Sign up
= render 'devise/shared/links'
これにより、次の HTML が生成されます (入力用)。
<input class="string email optional form-control"
id="user_email"
maxlength="255"
name="user[email]"
pattern="\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z"
size="255"
type="text" value="">
有効な電子メールが原因でこの検証がトリガーされるのはなぜですか? 助言がありますか?