Skip to content

Commit 92a3c8d

Browse files
author
Arthur Nogueira Neves
committed
Merge pull request rails#19438 from yui-knk/fix/comment
[ci skip] Check a result of `valid?` instead of `create`
2 parents 3464021 + cd83775 commit 92a3c8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

actionview/lib/action_view/helpers/form_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ module Helpers
6969
# controller gets a nested hash <tt>params[:person]</tt> with the person attributes
7070
# set in the form. That hash is ready to be passed to <tt>Person.create</tt>:
7171
#
72-
# if @person = Person.create(params[:person])
72+
# @person = Person.create(params[:person])
73+
# if @person.valid?
7374
# # success
7475
# else
7576
# # error handling

0 commit comments

Comments
 (0)