File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ create account hook:
26
26
enable :login, :logout, :create_account
27
27
28
28
before_create_account do
29
- # Validate presence of the name field
30
- unless name = param_or_nil("name")
29
+ # Validate the name field. This example checks that it is not empty,
30
+ # but you may want to have application specific checks.
31
+ unless name = param("name").empty?
31
32
throw_error_status(422, "name", "must be present")
32
33
end
33
34
@@ -52,8 +53,8 @@ You can then handle the new submitted field as follows:
52
53
enable :login, :logout, :create_account
53
54
54
55
before_create_account do
55
- # Validate presence of the name field
56
- throw_error_status(422, "name", "must be present") unless param_or_nil ("name")
56
+ # Validate the name field
57
+ throw_error_status(422, "name", "must be present") unless param ("name").empty?
57
58
end
58
59
59
60
after_create_account do
You can’t perform that action at this time.
0 commit comments