-
Notifications
You must be signed in to change notification settings - Fork 266
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
SimpleForm and error_notification #101
Comments
Thanks for letting me know. I thought I caught all the changes. Could you let me know where Simple Form and the error_notification method still appear? |
Searching through Book Two V4.1.0, error_notification showed up 2 times and SimpleForm showed up 16 times. |
Thanks. I'm working on a revision of Chapter 19 the "Contact Form" chapter today and I will check for any residual mentions of Simple Form and error_notification. |
With SimpleForm removed, validation behavior changed. Outdated texts are highlighted below in italic font.
I think your intention is for next iteration of code and book to display a flash warning message if @contact.valid? is false, before rendering 'new' template. |
I'm lost at this page, where mention of an error_notification method is made, but there is none visible in the code, and my app doesn't display any errors when I leave out name, email etc on the form. |
@cmilr since SimpleForm gem isn't included, error_detection method is unavailable. Refer to create method in app/controllers/contacts_controller.rb. Since @contact.valid? is false if name, email, or content is missing, the visitor will just be redirected to the same form to fill in the required fields. Hence my above comments "I think your intention is for next iteration of code and book to display a flash warning message if @contact.valid? is false, before rendering 'new' template (again)." |
Thanks, yeah I see that. I'm just hoping to hear for a workaround to get error notifications. |
@cmilr Try this in ContactsController#create method: |
SimpleForm gem was removed and replaced with Rails 5.1 form_with in Book Two Version 4.1.0, Yet, SimpleForm and error_notification method still appear multiple times throughout the book.
The text was updated successfully, but these errors were encountered: