How do you edit devise error messages?

To be clear, I know how to edit error messages in config / locales / devise.en.yml, but I mean the style of these error messages:

2 errors prohibited this user from being saved:
  • Email cannot be empty.
  • Password cannot be empty

-

All I see is & lt;% = devise_error_messages! %> on the registration page, but I don’t know how to actually edit error messages.

In my case, the messages appear on the left, and my sign is centered (which looks strange), I also do not like the red color of the messages and prefer a different color.

So my question is: how can I create an error message? center it and change color.

Not sure which other controllers or contents to include, as soon as you ask, I will update the OP with them if necessary.

+5
1

. devise_error_messages! https://github.com/plataformatec/devise/blob/master/app/helpers/devise_helper.rb.

<div id="error_explanation"> 

CSS. : h2 , ul . . SO #errorExplanation, : . #errorExplanation #error_explanation .

, , - , , , .

, . . SO, , , : Rails: , .

simple_form ( - ). . , Railscast: http://railscasts.com/episodes/234-simple-form. Railscast, , Pro .

+8

All Articles