Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # copy placeholders to params so we cal validate them
- $self->hook( around_action => sub {
- my ($next, $c, $action, $last) = @_;
- my $captures = $c->stash('mojo.captures');
- for my $key ( keys %{ $captures } ) {
- next if $key =~ m{\A(?:action|controller)\z};
- $c->validation->input->{$key} = $captures->{$key};
- }
- return $next->();
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement