Created
January 30, 2016 01:19
-
-
Save sherwind/6817296decb2bbb4d626 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create | |
post '/users' => sub { | |
my $user = resultset('User')->new_result({}); | |
my $form = SampleApp::Form::User->new; | |
$form->process(item => $user, params => { params }); | |
if ($form->validated) { | |
sign_in $user; | |
deferred success => 'Welcome to the Sample App!'; | |
redirect uri_for('/users/' . $user->id); | |
} else { | |
template 'users/new' => { form => $form }; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment