Skip to content

Commit 624506c

Browse files
committed
text change and readded failure event form_config_helper
1 parent a662280 commit 624506c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/getting-started/quick-start.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ end
581581

582582
* [x] Navigate to `localhost:3000/posts`
583583

584-
Great! Now we get instant feedback after performing successful or non successful form submissions! And still no line of JavaScript involved! The same approach would work for our actions, but we do not want to have that feedback after performing the actions in this example!
584+
Great! Now we get instant feedback after performing successful or unsuccessful form submissions! And still no line of JavaScript involved! The same approach would work for our actions, but we do not want to have that feedback after performing the actions in this example!
585585

586586
All of the above described reactivity only applies for one client. A second user wouldn't see the new post, unless he reloads his browser page. But of course, we want to sync all connected clients! It's time to integrate ActionCable!
587587

@@ -690,8 +690,9 @@ end
690690
def form_config_helper
691691
{
692692
for: Post.new, path: posts_path, method: :post,
693-
errors: { wrapper: { tag: :div, class: 'invalid-feedback' }, input: { class: 'is-invalid' } },
694-
success: { emit: "submitted" }
693+
success: { emit: "submitted" },
694+
failure: { emit: "form_failed" },
695+
errors: { wrapper: { tag: :div, class: 'invalid-feedback' }, input: { class: 'is-invalid' } }
695696
}
696697
end
697698

0 commit comments

Comments
 (0)