Advertisement
Guest User

Untitled

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