Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use form_with, requre email, handle rails 7 form redirect #128

Merged
merged 8 commits into from
Nov 30, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
validate regex in example
  • Loading branch information
yshmarov committed Nov 9, 2022
commit 414989a470541f738014d4d50485ad2ee4fde685
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ Then specify which field on your `User` record is the email field with:

```ruby
class User < ApplicationRecord
validates :email, presence: true, uniqueness: { case_sensitive: false }
validates :email,
presence: true,
uniqueness: { case_sensitive: false },
format: { with: URI::MailTo::EMAIL_REGEXP }

passwordless_with :email # <-- here!
end
Expand Down