Skip to content

Update devise_error_messages! calls#1540

Merged
damianhxy merged 1 commit into
masterfrom
update-devise-errors
May 28, 2022
Merged

Update devise_error_messages! calls#1540
damianhxy merged 1 commit into
masterfrom
update-devise-errors

Conversation

@damianhxy

Copy link
Copy Markdown
Member

Description

  • Replace calls to devise_error_messages! with render "devise/shared/error_messages", resource: resource

Motivation and Context

Message spotted in logs:

DEPRECATION WARNING: [Devise] DeviseHelper#devise_error_messages! is deprecated and will be
removed in the next major version.

Devise now uses a partial under "devise/shared/error_messages" to display
error messages by default, and make them easier to customize. Update your
views changing calls from:

<%= devise_error_messages! %>

to:

<%= render "devise/shared/error_messages", resource: resource %>

To start customizing how errors are displayed, you can copy the partial
from devise to your app/views folder. Alternatively, you can run
rails g devise:views which will copy all of them again to your app.

How Has This Been Tested?

  • Attempt to sign up with password not matching / password too short (<8 chars), errors show up as usual (registrations/new.html.erb)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run rubocop for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting
  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

@20wildmanj 20wildmanj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Confirmed that error messages still show up in user registration flow

LGTM!

@damianhxy damianhxy merged commit c409e92 into master May 28, 2022
@damianhxy damianhxy deleted the update-devise-errors branch May 28, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants