From cd83775858cde4bcbd934b5b8dc270b58ba0b9d1 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sat, 21 Mar 2015 09:30:48 +0900 Subject: [ci skip] Check a result of `valid?` instead of `create` --- actionview/lib/action_view/helpers/form_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index b0793d0b91..63bb4ce32f 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -69,7 +69,8 @@ module ActionView # controller gets a nested hash params[:person] with the person attributes # set in the form. That hash is ready to be passed to Person.create: # - # if @person = Person.create(params[:person]) + # @person = Person.create(params[:person]) + # if @person.valid? # # success # else # # error handling -- cgit v1.2.3