Closed pmckernin closed 4 years ago
@pmckernin LGTM!
One thing I notice is that the default error messages will use the model name, which is not always the best UX I think.
For example, a model like regional_manager
the default error messages will be something like:
Which is different than what happens on the update error page.
<% if @regional_manager.errors.any? %>
<% @regional_manager.errors.full_messages.each do |message| %>
<div class="alert">
<%= message %>
</div>
<% end %>
<% end %>
but maybe that is a change for a different PR.
@pmckernin LGTM
I added the code of
.errors.full_messages.to_sentence
to the create and update actions in the draft:account authentication_controller.To test, go to the snapshot below. I have already run the
draft:account
command. If you go to/user_sign_up
and add the same user twice it will show a message, then if you go tosign_in
and try to sign in with a bad password you should get a different message. To be clear, I have have already gone to the application.html layout page and placed code to make the messages visible.