Skip to content

Instantly share code, notes, and snippets.

@jjn1056
Last active August 13, 2022 18:35
Show Gist options
  • Save jjn1056/708088ddbc468edfa17e1a9fd587cdec to your computer and use it in GitHub Desktop.
Save jjn1056/708088ddbc468edfa17e1a9fd587cdec to your computer and use it in GitHub Desktop.
package Example::Model::RegistrationInterfaceModel;
use Valiant::IM::Form;
field user_name => type=>'InputGroup', %opts;
field first_name => type=>'InputGroup', %opts;
field last_name => type=>'InputGroup', %opts;
1;
package Example::Controller::Registration
sub root($self, $c) {
my $interface = $c->model('RegistrationInterfaceModel', model=>$c->user);
my $form = Valiant::IM::FormBuilderAdaptor->interface($interface);
$c->view(Registration => registration_form => $form ),
package Example::Model::RegistrationForm;
use Moose;
use Valiant::HTML::FormAdaptor;
input 'username';
input 'first_name';
input 'last_name';
password 'password';
password 'password_confirmation';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment